Title
std::promise synopsis shows two set_value_at_thread_exit()'s for no apparent reason
Status
c++17
Section
[futures.promise]
Submitter
Tim Song

Created on 2015-08-20.00:00:00 last changed 90 months ago

Messages

Date: 2015-11-04.18:48:42

Proposed resolution:

This wording is relative to N4527.

  1. Edit [futures.promise], class template promise synopsis, as indicated:

    namespace std {
      template <class R>
      class promise {
      public:
        […]
    
        // setting the result
        void set_value(see below);
        void set_exception(exception_ptr p);
        
        // setting the result with deferred notification
        void set_value_at_thread_exit(const R& r);
        void set_value_at_thread_exit(see below);
        void set_exception_at_thread_exit(exception_ptr p);
      };
    }
    
  2. Edit [futures.promise]/1 as indicated:

    -1- The implementation shall provide the template promise and two specializations, promise<R&> and promise<void>. These differ only in the argument type of the member functions set_value and set_value_at_thread_exit, as set out in its descriptiontheir descriptions, below.

Date: 2015-11-04.18:48:42

[ 2015-10, Kona issue prioritization ]

Priority 0, move to Ready

Date: 2015-08-20.19:08:10

In [futures.promise], the class synopsis shows

void set_value_at_thread_exit(const R& r);
void set_value_at_thread_exit(see below);

There's no apparent reason for having void set_value_at_thread_exit(const R& r);, especially as that signature isn't really present in the specializations (particularly promise<void>). Note that the similar set_value only has a void set_value(see below);

While we are here, [futures.promise]/p1 says that the specializations "differ only in the argument type of the member function set_value", which missed set_value_at_thread_exit.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-03-07 04:11:48adminsetstatus: ready -> wp
2015-11-04 18:48:42adminsetmessages: + msg7620
2015-11-04 18:48:42adminsetstatus: new -> ready
2015-08-20 19:08:10adminsetmessages: + msg7497
2015-08-20 00:00:00admincreate