GCC 4.7.2 (ソースからコンパイルされた cygwin 上) では、 usingは次std::async
のエラーで失敗します
error: invalid use of incomplete type
いくつかのstd::__async_sfinae_helper
。私は運が悪く、あなたの助けに感謝します.
#include <future>
int main()
{
std::async([]{});
}
で失敗します
g++ -Wall -pedantic -std=c++0x future.cpp -o future
future.cpp: In function 'int main()':
future.cpp:5:22: error: invalid use of incomplete type 'std::__async_sfinae_helper<main()::<lambda()>, main()::<lambda()> >::type {aka class std::future<void>}'
In file included from future.cpp:1:0:
/usr/local/lib/gcc/i686-pc-cygwin/4.7.2/../../../../include/c++/4.7.2/future:111:11: error: declaration of 'std::__async_sfinae_helper<main()::<lambda()>, main()::<lambda()> >::type {aka class std::future<void>}'
/usr/local/lib/gcc/i686-pc-cygwin/4.7.2/../../../../include/c++/4.7.2/future: At global scope:
/usr/local/lib/gcc/i686-pc-cygwin/4.7.2/../../../../include/c++/4.7.2/future:187:5: error: 'typename std::__async_sfinae_helper<typename std::decay<_Func>::type, _Fn, _Args ...>::type std::async(_Fn&&, _Args&& ...) [with _Fn = main()::<lambda()>; _Args = {}; typename std::__async_sfinae_helper<typename std::decay<_Func>::type, _Fn, _Args ...>::type = std::future<void>]', declared using local type 'main()::<lambda()>', is used but never defined [-fpermissive]
<builtin>: recipe for target `future' failed
バージョン情報
% g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-cygwin/4.7.2/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: ../gcc-4.7.2/configure --enable-languages=c,c++
Thread model: single
gcc version 4.7.2 (GCC)