Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#5990 closed Patches (fixed)

shared_future<T>::get() has wrong return type

Reported by: Jan Vogelgesang <jan.vogelgesang@…> Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost 1.48.0 Severity: Problem
Keywords: doc move shared_future Cc: Troy.Runkel@…, jonathan.jones@…

Description

The return type of shared_future<T>::get() seems to be mixed up. The actual code (Trunk) returns T by value. The documentation says 'return by value' at some places and 'return by const ref' at other places (e.g. in the running text). The C++11 standard requires 'return by const ref' too.

Attachments (1)

5590_5531.diff (7.7 KB ) - added by viboes 11 years ago.
Could you try the attached patch for this and #5531?

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 11 years ago

Same shared_future<T>::get() is broken on compilers that have rvalue (msvc 10). Simplest example is shared_future<std::string> , or any type that has move constructor. It will move away object on first call to get.

comment:2 by viboes, 11 years ago

Keywords: doc move shared_future added

comment:3 by Troy.Runkel@…, 11 years ago

Cc: Troy.Runkel@… added

by viboes, 11 years ago

Attachment: 5590_5531.diff added

Could you try the attached patch for this and #5531?

comment:4 by viboes, 11 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned
Version: Boost Development TrunkBoost 1.48.0

comment:5 by viboes, 11 years ago

Type: BugsPatches

comment:6 by viboes, 11 years ago

Milestone: To Be DeterminedBoost 1.49.0

comment:7 by viboes, 11 years ago

Committed in trunk at revision [76543].

comment:8 by viboes, 10 years ago

Milestone: Boost 1.49.0Boost 1.50.0
Resolution: fixed
Status: assignedclosed

Committed in release branch at [78543]

comment:9 by Jonathan Jones <jonathan.jones@…>, 10 years ago

Cc: jonathan.jones@… added
Note: See TracTickets for help on using tickets.