Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/125.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 实践std::variant,它存在吗?_C++_C++17 - Fatal编程技术网

C++ 实践std::variant,它存在吗?

C++ 实践std::variant,它存在吗?,c++,c++17,C++,C++17,考虑到我试过: 它在哪里?看起来它使用的是过时的4.2.1版。您需要7.1版以获得最多的C++17支持。我可以在不破坏macOS的情况下进行更新吗?我应该如何进行?我想我上周安装了Xcode的更新。您在哪里阅读4.2.1(我看到了8.1.0)?--使用gxx include dir=/usr/include/c++/4.2.1Xcode版本不是铿锵版本。Xcode没有宣传“我们是另一个编译器的包装器,我们的版本是古老的”。讨厌。@NathanOliver这不是真正的g++@AlexZywicki

考虑到我试过:


它在哪里?

看起来它使用的是过时的4.2.1版。您需要7.1版以获得最多的C++17支持。我可以在不破坏macOS的情况下进行更新吗?我应该如何进行?我想我上周安装了Xcode的更新。您在哪里阅读4.2.1(我看到了8.1.0)?
--使用gxx include dir=/usr/include/c++/4.2.1
Xcode版本不是铿锵版本。Xcode没有宣传“我们是另一个编译器的包装器,我们的版本是古老的”。讨厌。@NathanOliver这不是真正的g++@AlexZywicki世界上没有
这样的东西。看起来它使用的是过时的版本4.2.1。您需要7.1版以获得最多的C++17支持。我可以在不破坏macOS的情况下进行更新吗?我应该如何进行?我想我上周安装了Xcode的更新。您在哪里阅读4.2.1(我看到了8.1.0)?
--使用gxx include dir=/usr/include/c++/4.2.1
Xcode版本不是铿锵版本。Xcode没有宣传“我们是另一个编译器的包装器,我们的版本是古老的”。讨厌。@NathanOliver这不是真正的g++@世界上没有
这样的东西。
#include <variant>
int main (){}
$ g++ -std=c++1z main.cpp 
main.cpp:3:10: fatal error: 'variant' file not found
#include <variant>
         ^
1 error generated.
$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0