Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2311 closed Feature Requests (fixed)

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 (1)

any_assignment.patch (394 bytes) - added by Niels Dekker 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Niels Dekker

Attachment: any_assignment.patch added

comment:1 Changed 9 years ago by nasonov

Type: BugsFeature Requests

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

comment:2 Changed 9 years ago by nasonov

Resolution: fixed
Status: newclosed

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

comment:3 Changed 9 years ago by nasonov

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

comment:4 Changed 9 years ago by nasonov

Milestone: Boost 1.37.0Boost 1.38.0

comment:5 Changed 9 years ago by Niels Dekker

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain nasonov.
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.