Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 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 6 years ago.
Could you try the attached patch for this and #5531?

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by anonymous

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 Changed 6 years ago by viboes

Keywords: doc move shared_future added

comment:3 Changed 6 years ago by Troy.Runkel@…

Cc: Troy.Runkel@… added

Changed 6 years ago by viboes

Attachment: 5590_5531.diff added

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

comment:4 Changed 6 years ago by viboes

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

comment:5 Changed 6 years ago by viboes

Type: BugsPatches

comment:6 Changed 6 years ago by viboes

Milestone: To Be DeterminedBoost 1.49.0

comment:7 Changed 6 years ago by viboes

Committed in trunk at revision [76543].

comment:8 Changed 5 years ago by viboes

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

Committed in release branch at [78543]

comment:9 Changed 5 years ago by Jonathan Jones <jonathan.jones@…>

Cc: jonathan.jones@… added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.