This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
packaged_task::operator bool()Section: 32.10.10[futures.task]Status:ResolvedSubmitter: INCITSOpened: 2010-08-25Last modified: 2016-01-28
Priority:Not Prioritized
View all otherissues in [futures.task].
View all issues withResolved status.
Discussion:
Addresses US-201
packaged_task providesoperator bool() to check whetheran object has an associated asynchronous state. The variousfuture types provide a member functionvalid() 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()withpackaged_task::valid()in the synopsis(32.10.10[futures.task]/2) and the member function specification (before 32.10.10.2[futures.task.members]/15).
[2010-11-02 Daniel translates proposed wording changes into a proper proposed resolutionand verified that no other places implicitly take advantage ofpackaged_task conversion to bool.]
[Resolved in Batavia by acceptingn3194.]
Proposed resolution:
packaged_task synopsis as indicated:template<class R, class... ArgTypes>class packaged_task<R(ArgTypes...)> {public: typedef R result_type; [..]explicit operator boolvalid() const; [..]};explicit operatorboolvalid() const;15Returns: true only if
16Throws: nothing.*thishas an associated asynchronous state.