- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a minimal example, the problem seems to be related to lambda.
#include <future>
void say () { /* do nothing */ }
int main ()
{
auto handle = std::async(say);
handle.get();
return 0;
}
Here is the error message, I delete the "instantiation of ..." etc. messages
/usr/include/c++/4.7/future(1453): error: invalid designator kind
_M_thread = std::thread{ [this] {
^
/usr/include/c++/4.7/future(1453): error: expression must have a constant value
_M_thread = std::thread{ [this] {
^
/usr/include/c++/4.7/future(1454): error: expected a "}"
_M_set_result(_S_task_setter(_M_result, _M_fn));
^
/usr/include/c++/4.7/future(1453): error: function "std::thread::operator=(const std::thread &)" (declared at line 144 of "/usr/include/c++/4.7/thread") cannot be referenced -- it is a deleted function
_M_thread = std::thread{ [this] {
^
/usr/include/c++/4.7/future(524): error: type name is not allowed
return _Setter{ __ptr, std::ref(__call) };
^
/usr/include/c++/4.7/bits/alloc_traits.h(56): error: expression must have a constant value
static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);
^
/usr/include/c++/4.7/bits/alloc_traits.h(201): error: incomplete type is not allowed
using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
^
/usr/include/c++/4.7/bits/alloc_traits.h(89): error: name followed by "::" must be a class or namespace name
typedef typename _Alloc::value_type value_type;
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi woodwind,
I can reproduce this too. I've reported it to our front end team, and I'll let you know when more progress in the investigatino is made. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
are there any updates? I'm getting the same error with the icpc version 13.1.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Same question, any update for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This doesn't compile with gcc 4.8.1 either, while it compiles fine with g++.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An update. icc 14.0 supports gcc 4.7 & 4.8 now.
Feilong

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page