gpt4 book ai didi

c++ - 如何在 g++ 中使用 C++ 20

转载 作者:行者123 更新时间:2023-12-04 12:29:29 26 4
gpt4 key购买 nike

我正在尝试访问 std::popcount ,但似乎是 only there in C++ 20 .
当我尝试使用 g++ -std=c++20 main.cpp 进行编译时,上面写着 g++: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++03'我如何告诉 g++ 使用 c++ 20?
我正在使用 Ubuntu 18.04

最佳答案

我会尝试更新gcc。 C++ 20 是在 gcc 版本 8 中引入的,这是非常新的。

关于c++ - 如何在 g++ 中使用 C++ 20,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66975491/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com