我正在运行以下代码

问题描述 投票:0回答:0
#include <thread> #include <iostream> int main() { std::jthread {[] {std::cout << "Hi" << std::endl;}}; }

CMAKEPRINTS
-- The C compiler identification is AppleClang 13.0.0.13000027
-- The CXX compiler identification is AppleClang 13.0.0.13000027

迈克打印错误:

eRror:在命名空间'std'中没有名为“ jthread”成员 std :: jthread {[] {std :: cout

    

添加
-stdlib=libc++ -fexperimental-library

<< "Hi" << std::endl;}};

c++ clang
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.