When I use the keyword static with a class member I usually put it before the return type in this way:
class Problem {
public:
static void solve() {}
}
I just noticed on VS2010 it works the same inverting it with the return type:
class Problem {
public:
void static solve() {}
}
What does the standard say about this? Has this any other implications I should be aware of, or is it exactly the same?
The order of the various components of the decl-specifier-seqopt (ISO/IEC 14882:2011, §7 Declarations) is largely arbitrary. In particular, storage classes (such as ‘static’) can be mixed in with the type information, though having the storage class other than first is marked obsolescent in the C standard (but not, as far as I can see, in the C++ standard).