template <typename T> class ConstType { public: typedef const T MyConst; }; ConstType<const int>::MyConst i = 0;
Note the double const, and the compiler does not complain about it.
Reference: Modern C++ Design
template <typename T> class ConstType { public: typedef const T MyConst; }; ConstType<const int>::MyConst i = 0;
No comments:
Post a Comment