【发布时间】:2024-04-17 15:55:01
【问题描述】:
为什么下面的代码编译失败:
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/assert.hpp>
#include <string>
int main()
{
BOOST_MPL_ASSERT(( boost::mpl::is_same<std::string, std::string> ));
return 0;
}
我收到 C++11 和 C++14 的错误:
In file included from 2:0:
In function 'int main()':
7:5: error: expected primary-expression before 'enum'
我知道这可能很愚蠢,比如缺少分号。错误信息肯定没有帮助。
【问题讨论】:
标签: c++ c++11 boost static-assert