To avoid this problem in future, maybe we should define a macro in
<simgear/compiler.h>.  Something like:

#ifdef SG_NO_INCLASS_MEMBER_INITIALIZATION
# define SG_STATIC_CONSTANT(type, assignment) enum { assignment }
#else
# define SG_STATIC_CONSTANT(type, assignment) static const type
assignment
#endif

Usage then becomes:

class Foo {
  SG_STATIC_CONSTANT(int, FG_MAX_ENGINES = 4);
  ...
}

which expands to either
 static const int FG_MAX_ENGINES = 4;
or
 enum { FG_MAX_ENGINES = 4; };

I think the problem with Norman's solution is that you can't use the
value later in the class declaration, as an array size for example.

Cheers,
Bernie

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to