Custom Query (545 matches)
Results (25 - 27 of 545)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#28 | fixed | Revise error.h and error_test.cc | ||
Description |
|
|||
#29 | fixed | Using \tparam doxygen command | ||
Description |
We should use |
|||
#30 | fixed | Erroneous initialization of static members | ||
Description |
Only static integral constant members can be initialized by adding a constant-expression initializer to their member declaration. In practice this means: class Foo { public: static const int a = 5; // this is ok static const double b = 1.5; // this is not ok // (double is not an integral type) }; The correct form: class Foo { public: static const int a = 5; static const double b; }; const double Foo::b = 1.5; // this line goes to the .cc file
Note that if (and only if) you need to use an initialized member in a way that requires it to be stored as an object in memory, the member must be defined somewhere. This means that for example if you need to take the address of const int Foo::a; // in the .cc file
In case template<typename T> class Foo { public: static const int a = 5; static const double b; }; template<typename T> const double Foo<T>::b = 1.5; // in the .h file The above described problem occurs at the following places in the SVN tree:
You can find these by invoking g++ with the -ansi and -pedantic flags (and by running |