5

This is my first post here so please be lenient :)

I am having a problem with set_value_at_thread_exit() method from promise class (part of c++11). Everything was ok in VS2013 but GCC gives me following error message:

error: ‘class std::promise<int>’ has no member named ‘set_value_at_thread_exit’
    args->result.set_value_at_thread_exit(result);

I've tried GCC 4.8 and 4.9 on Ubuntu 14.04

The code is:

[...]

int result = 0;
Socket socket;
result = CreateUDPSocket(&socket, false, ANY_IP, args->port);
if (result != ERROR_SUCCESS)
{
    args->result.set_value_at_thread_exit(result);
    return;
}
args->result.set_value(ERROR_SUCCESS);

[...]
manlio
  • 18,345
  • 14
  • 76
  • 126

1 Answers1

7

Unfortunately, it isn't supported yet. If you look at the status page

30.6.5 | Class template promise | Partial | Missing set_*_at_thread_exit

Praetorian
  • 106,671
  • 19
  • 240
  • 328
  • One of the prices of using open source software. The thing has been in the spec since C++11 and GCC 4.9.2, which has C++14 stuff still doesn't have it. – Kelly Beard Jul 02 '15 at 15:25