Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.

1508. Renamepackaged_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 namepackaged_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:

  1. Change 32.10.10[futures.task]/2, class templatepackaged_task synopsis as indicated:
    template<class R, class... ArgTypes>class packaged_task<R(ArgTypes...)> {public:  typedef R result_type;  [..]explicit operator boolvalid() const;  [..]};
  2. Change 32.10.10[futures.task] before p. 15 as indicated:
    explicit operator boolvalid() const;

    15Returns: true only if*this has an associated asynchronous state.

    16Throws: nothing.


[8]ページ先頭

©2009-2026 Movatter.jp