在编译以下内容时,我收到一个错误,即'literals'不是命名空间名称
#include <complex>
using namespace std::literals;
...
它在Windows上使用MSVC编译,甚至在带有clang的OS X上编译,但在使用gcc和intel的icpc的redhat 7上失败。
更多细节:
系统
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
gcc版
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
英特尔编译器版
icpc --version
icpc (ICC) 16.0.3 20160415
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
编译器调用
gcc filename.cpp -std=c++1y
icpc filename.cpp -std=c++14
我错过了什么?
ps:即使像in this live demo之类的简单代码也无效:(