0

When I initialize a variable, I usually use "()".

int myVariable(5);

This used to work all the time but the following throws a compilation error!

struct Database
{
public:
    Database();
    ~Database();
    static constexpr uint8_t variable(10); // ERROR!
    static constexpr uint8_t variable2 = 10; // Fine
};

Apparently, I cannot use the parenthesis here but the "=" works fine! Why is that?

Errors from the compiler: "expected identifier before numeric constant" and "expected ',' or '...' before numeric constant".

Shinagan
  • 435
  • 3
  • 15

0 Answers0