Modify

Ticket #5990 (closed Patches: fixed)

Opened 3 years ago

Last modified 22 months ago

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

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

Change History

comment:1 Changed 2 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 2 years ago by viboes

  • Keywords doc move shared_future added

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

  • Cc Troy.Runkel@… added

Changed 2 years ago by viboes

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

comment:4 Changed 2 years ago by viboes

  • Owner changed from anthonyw to viboes
  • Status changed from new to assigned
  • Version changed from Boost Development Trunk to Boost 1.48.0

comment:5 Changed 2 years ago by viboes

  • Type changed from Bugs to Patches

comment:6 Changed 2 years ago by viboes

  • Milestone changed from To Be Determined to Boost 1.49.0

comment:7 Changed 2 years ago by viboes

Committed in trunk at revision [76543].

comment:8 Changed 23 months ago by viboes

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone changed from Boost 1.49.0 to Boost 1.50.0

Committed in release branch at [78543]

comment:9 Changed 22 months ago by Jonathan Jones <jonathan.jones@…>

  • Cc jonathan.jones@… added
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.