Hello,
I'm getting a strange compiler error. My code (located in a header file) is as follows:
namespace myNamespace
{
class Globals
{
public:
static const double myDouble= 6.9;
static const int myInt= 6;
...
};
}
I get the compiler error "Illegal constant expression" on the line "static const double myDouble= 6.9;", but not on the line with " static const int myInt= 6;". In fact, the compiler gives that error for all doubles, but integers, shorts, and bools seem to be fine
Any help would be appreciated.
Thanks,
Neville
example.h: class Globals { public: static const double myDouble; ...example.cpp:#include "example.h"const double Globals::myDouble= 6.9;