C++11 feature checking

核能气质少年 提交于 2019-11-29 04:28:40
mirk

boost config comes with a script to check for some but not all C++11 features.

It generates a config-file with macros for each feature.

Your build-tool may be able to help with this.

CMake has the try_compile command which allows you to test whether a code sample will compile and set a variable based on the result of compilation.

At the moment I've just been using the more commonly supported features such as auto typing.

You can often use Boost to replace the missing library features, and this may be the best option for a few year while compilers and libraries are updated and bugs fixed.

The C++11 feature compatibility list for GCC is here: http://gcc.gnu.org/projects/cxx0x.html

Note the warning:

Important: GCC's support for C++11 is still experimental. Some features were implemented based on early proposals, and no attempt will be made to maintain backward compatibility when they are updated to match the final C++11 standard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!