I have class with a counter declared as static and I defined an assessor on the variables
The following code works:
Code:
class {
static int counter;
...
static int getCounter () {return counter;}
};
The method defined in the header of a class are inline by default. You can do this by defining the methods "inline" in the *.h but outside the class.
But the following code does not work:
Code:
class {
static int counter;
...
};
inline static int getCounter () {return counter;}
I have the impression that the compiler makes an error because it can not distinguish that it is a static method of a method that has a static return type.
Someone to a solution, please?
Bookmarks