如何检查C ++ 11支持? [英] How do I check for C++11 support?

查看:214
本文介绍了如何检查C ++ 11支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果编译器支持C ++ 11的某些功能,有没有方法在编译时检测?例如,像这样:

Is there a way to detect at compile-time if the compiler supports certain features of C++11? For example, something like this:

#ifndef VARIADIC_TEMPLATES_SUPPORTED

#error "Your compiler doesn't support variadic templates.  :("

#else

template <typename... DatatypeList>
class Tuple
{
    // ...
}

#endif


推荐答案

Boost.Config 具有大量宏可用于测试对特定C ++ 11功能的支持。

Boost.Config has a plethora of macros that can be used to test for support for specific C++11 features.

这篇关于如何检查C ++ 11支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆