
25 Jul
2006
25 Jul
'06
1:30 a.m.
In order to avoid having an unnamed namespace inside a header file, none.hpp has been rewritten as namespace boost { none_t const none = ((none_t)0) ; } // namespace But if two source files contain none.hpp won't this violate the one-definition rule? What's wrong with defining none_t and none as follows: namespace boost { enum none_t {none = 0}; } This allows us to have a unique value boost::none of type boost::none_t that can be included in any number of source files without violating the ODR. Joe Gottman