OpenNuvoton/NUC970_Buildroot

使用c++11标准中的std::tuple编译报错

YamgXion opened this issue · 1 comments

`auto print_ten = [](char c, int ms) {
for (int i = 0; i < 10; i++) {
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
std::cout << c;
}
};
std::cout << "with lanuch::async:\n";
auto foo = std::async(std::launch::async, print_ten, '*', 100);
std::future bar = std::async(std::launch::async, print_ten, '@', 200);
//foo.get();
bar.get();
std::cout << "\n\n";

std::cout << "with lanuch::deferred:\n";
std::future<void> foo2 = std::async(std::launch::deferred, print_ten, '*', 100);
std::future<void> bar2 = std::async(std::launch::deferred, print_ten, '@', 200);
//foo2.get();
bar2.get();
std::cout << "\n";`

使用arm-linux-g++编译报错
[build] /home/workdir/hello/hello.cpp:58:66: 错误:对不完全的类型‘class std::future’的非法使用
[build] auto foo = std::async(std::launch::async, print_ten, '*', 100);
[build] ^
[build] In file included from /home/workdir/hello/hello.cpp:3:0:
[build] /usr/local/arm_linux_4.8/arm-nuvoton-linux-uclibceabi/include/c++/4.8.4/future:113:11: 错误:‘class std::future’的声明
[build] class future;
[build] ^

Please follow the instructions in README
#make nuc970_defconfig
#make