gpt4 book ai didi

c++ - 在 Eclipse 上启用 C++17 以使用 `std::byte`

转载 作者:太空狗 更新时间:2023-10-29 21:33:08 25 4
gpt4 key购买 nike

我想使用 #include <cstddef>std::byte来自 c++17 on eclipse photon。我已将项目配置为使用 c++17 进行编译 >> project >> properties >> C/C++ Build >> settings >> GCC C++ Compiler >> Dialect >> Other dialect flags >> -std=c++17我也试过-std=c++1z .我下面的程序可以使用 <cstddef>图书馆,但符合std::byte不编译。 Eclipse 说 Type 'std::byte' could not be resolved .如何让 Eclipse 支持 C++17?

#include <cstddef>

int main(void) {
std::byte myByte { 2 };
}

谢谢

最佳答案

我使用(eclipse 4.7.3agcc 7.3.0 MinGW-W64)。C++17 与标志 --std=c++1z

配合得很好
project >> properties >> C/C++ Build >> settings >> GCC C++ Compiler >> Dialect >> Other dialect flags >> --std=c++1z

关于c++ - 在 Eclipse 上启用 C++17 以使用 `std::byte`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52605058/

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