This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.
Section: 33.10.10 [futures.task] Status: Resolved Submitter: INCITS Opened: 2010-08-25 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [futures.task].
View all issues with Resolved status.
Discussion:
Addresses US-201
packaged_task provides operator bool() to check whether an object has an associated asynchronous state. The various future types provide a member function valid() that does the same thing. The names of these members should be the same.
[ Resolution proposed by ballot comment: ]
Replaced the name packaged_task::operator bool() with packaged_task::valid() in the synopsis (33.10.10 [futures.task]/2) and the member function specification (before 33.10.10.2 [futures.task.members]/15).
[ 2010-11-02 Daniel translates proposed wording changes into a proper proposed resolution and verified that no other places implicitly take advantage of packaged_task conversion to bool. ]
[Resolved in Batavia by accepting n3194. ]
Proposed resolution:
template<class R, class... ArgTypes> class packaged_task<R(ArgTypes...)> { public: typedef R result_type; [..]explicit operatorbool valid() const; [..] };
explicit operatorbool valid() const;15 Returns: true only if *this has an associated asynchronous state.
16 Throws: nothing.