2010/12/3 Václav Haisman <v.haisman@sh.cvut.cz>
On Thu, 2 Dec 2010 20:25:26 +0100, Krzysztof Czainski wrote:
2010/12/2 Krzysztof Czainski

#ifdef __TI_COMPILER_VERSION__
  namespace { void_ void_instance = {}; }
#endif // __TI_COMPILER_VERSION__
Does this not violate the ODR? The anonymous namespace is different for each TU => void_reference() will be different in each TU.


  inline void_& void_reference()
   {
#ifdef __TI_COMPILER_VERSION__
      return void_instance;
#else // __TI_COMPILER_VERSION__
      static void_ instance;
      return instance;
#endif // __TI_COMPILER_VERSION__
  }

--
VH

Thanks for pointing this out. In that case, what do You think of putting the whole void_reference() function into an anonymous namespace?

Regards
Kris