Opened 14 years ago
Last modified 12 years ago
#2312 new Patches
intrusive_ptr::operator= should have by-value argument
Reported by: | niels_dekker | Owned by: | Peter Dimov |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.36.0 | Severity: | Optimization |
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 (2)
Change History (7)
by , 14 years ago
Attachment: | intrusive_ptr_assignment.patch added |
---|
comment:1 by , 14 years ago
Component: | None → smart_ptr |
---|---|
Owner: | set to |
Severity: | Problem → Optimization |
Status: | new → assigned |
Type: | Bugs → Patches |
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Milestone: | Boost 1.37.0 → To Be Determined |
---|
comment:4 by , 13 years ago
I updated #2314 and attach a new trivial patch which includes elimination of the converting assignments.
Best regards
by , 13 years ago
Attachment: | intrusive_ptr.ass.value.patch added |
---|
comment:5 by , 12 years ago
Status: | assigned → new |
---|
Note:
See TracTickets
for help on using tickets.
This ticket depends on #2314.
Changing the assignment operator as suggested also allows us to eliminate the converting assignment.