This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] c++0x includes


Doug Gregor wrote:
On 3/11/07, Peter Dimov <pdimov@mmltd.net> wrote:
I guess it could be, depending on the compiler... my copy of C++03
still says 199711L in [cpp.predefined], though. One can always play
safe and check against 200703L.

Gaa! That sets a very scary precedent, I think. It at least invites us to be clever:

#if __cplusplus > 200703L
// add rvalue reference support
 #if __cplusplus > 200708L
 // add decltype support
   #if __cplusplus > 200711L
   // add concepts support
   #endif
 #endif
#endif

No, no. My point is that __cplusplus can be one of:


unspecified five-digit number // pre-standard C++
199711L // C++98, conforming C++03
unspecified value between 199712L and 200312L // 'detectable' C++03
unspecified value >= 200703L (now) // C++09

(ignoring subsequent standards)

so in theory a single test is enough to detect C++09 even without knowing the exact value.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]