Modify

Ticket #2311 (closed Feature Requests: fixed)

Opened 6 years ago

Last modified 5 years ago

any::operator= should have by-value argument

Reported by: niels_dekker Owned by: nasonov
Milestone: Boost 1.38.0 Component: any
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc: niels_dekker

Description

When a copy assignment operator is implemented simply by doing copy-and-swap, it should pass its argument by value, instead of doing the copy inside the body of the function, to allow the compiler to do copy elision. As was discussed at the Boost developer mailing list,  Improving the assignment operators of various Boost types.

So please consider the attached patch.

Attachments

any_assignment.patch Download (394 bytes) - added by niels_dekker 6 years ago.

Change History

Changed 6 years ago by niels_dekker

comment:1 Changed 6 years ago by nasonov

  • Type changed from Bugs to Feature Requests

This is not a bug, this is a feature request.

comment:2 Changed 5 years ago by nasonov

  • Status changed from new to closed
  • Resolution set to fixed

(In [50120]) Fixes #2311: any::operator= should have by-value argument

comment:3 Changed 5 years ago by nasonov

(In [50122]) Fixes #2311: any::operator= should have by-value argument

comment:4 Changed 5 years ago by nasonov

  • Milestone changed from Boost 1.37.0 to Boost 1.38.0

comment:5 Changed 5 years ago by niels_dekker

Thank you very much, Alexander! I just double-checked, it looks fine to me.

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.