Boost logo

Boost Users :

Subject: Re: [Boost-users] boost/parameter/keyword.hpp warning, TI compiler
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2010-12-03 05:36:52


2010/12/3 Václav Haisman <v.haisman_at_[hidden]>

> 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



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net