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.

1272. confusing declarations of promise::set_value

Section: 32.10.6 [futures.promise] Status: Resolved Submitter: Jonathan Wakely Opened: 2009-11-22 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [futures.promise].

View all other issues in [futures.promise].

View all issues with Resolved status.

Discussion:

The definitions of promise::set_value need tidying up, the synopsis says:

// setting the result
void set_value(const R& r);
void set_value(see below);

Why is the first one there? It implies it is always present for all specialisations of promise, which is not true.

The definition says:

void set_value(const R& r);
void promise::set_value(R&& r);
void promise<R&>::set_value(R& r);
void promise<void>::set_value();

The lack of qualification on the first one again implies it's present for all specialisations, again not true.

[ 2010 Pittsburgh: Moved to NAD EditorialResolved. Rationale added below. ]

Rationale:

Solved by N3058.

Proposed resolution:

Change the synopsis in 32.10.6 [futures.promise]:

// setting the result
void set_value(const R& r);
void set_value(see below);

And the definition be changed by qualifying the first signature:

void promise::set_value(const R& r);
void promise::set_value(R&& r);
void promise<R&>::set_value(R& r);
void promise<void>::set_value();