Talk:cpp/thread/future

§ 30.6.6.3 States "The effect of calling any member function other than the destructor, the move-assignment operator, or on a  object for which  is undefined. [ Note: Implementations are encouraged to detect this case and throw an object of type  with an error condition of . —end note ]"

I would like to add something akin to the following paragraph in the appropriate member functions' pages (,, , , and ):

A precondition of this function is that cpp/thread/future/valid. If this is not met, Standard Library implementations are encouraged to throw a cpp/thread/future_error with an error condition of cpp/thread/future_errc.

However, I'm not sure if mentioning the contents of the Note are appropriate, and if so, should that be added to an "Exceptions" section?

Fraser 18:15, 13 January 2013 (PST)


 * I think that would be a good addition, but perhaps it would most naturally fit under a "Notes" section on each page (see e.g. http://en.cppreference.com/w/cpp/string/basic_string/c_str). --Nate 15:03, 14 January 2013 (PST)


 * Thanks for the tip. Added under "Notes" now. Fraser 16:42, 14 January 2013 (PST)

--AhmedHan (talk) 23:52, 6 September 2018 (PDT) All of the examples work with lambda expressions. Why don't we put some realistic example code which runs with a member function.
 * what is realistic about member functions and how would they make the life cycle of std::future clearer? --Cubbi (talk) 07:08, 7 September 2018 (PDT)