Re: [sigc] C++0x lambdas



On 01/05/2012 04:05 PM, Chow Loong Jin wrote:
The only macro I can find to do with detecting C++0x is
__GXX_EXPERIMENTAL_CXX0X__ which is probably not portable. __cplusplus is
supposed to be defined to a value greater than 199711L, but on my system it
seems to be defined without a value, defaulting to 1.

After browsing GCC's site, I've stumbled on this thread from GCC's mailing list:

http://gcc.gnu.org/ml/libstdc++/2000-11/msg00008.html

In short:
</discussion>
Phil Edwards: The __cplusplus macro isn't defined. Shouldn't it be set to 199711L?
Gabriel Dos Reis: ok, let's give it a try and see what breaks.
Benjamin Kosnik: Lots of stuff breaks. Let's deal with this later.
</discussion>

I've tested the macro with GCC 4.6.1, compiled with the -std=c++98 and -std=c++0x flags. Neither appears to define the __cplusplus macro accordingly. So, this looks like a compiler bug.


Rui Maciel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]