Checking for availability of C++0x algorithm additions

前端 未结 2 727
后悔当初
后悔当初 2021-01-06 21:12

I\'m trying to figure out which of the additions to the algorithm headers are supported by a given implementation (gcc and MSVC would be enough).

The simple way woul

2条回答
  •  悲哀的现实
    2021-01-06 21:25

    Since all compiler vendors provide a nice list of what's available in what version, and you would test the functionality anyways, I would use compiler versions to check for specific features. Or demand the user uses at least a good version, and not worry about it.

    __cplusplus is not necessarily a C++0x macro, it tells you nothing. GXX_EXPERIMENTAL has existed since GCC 4.3, so that's pretty useless too.

    • This one is for GCC.

    • This one is for MSVC. (mind you: partially implemented means broken)

    • This one is for Intel.

    Here you can find what macros to check against for a specific version of a compiler.

提交回复
热议问题