|
Boost : |
Subject: Re: [boost] Improving the assignment operators of various Boost types
From: Niels Dekker - mail address until 2008-12-31 (nd_mail_address_valid_until_2008-12-31_at_[hidden])
Date: 2008-09-11 13:01:52
David Abrahams wrote:
> Niels: are you planning to pursue tickets for the classes with
> implicit assignment operators and the others I mentioned in
> response to your original post?
Honestly I haven't yet looked into those. But my idea was to start off
by submitting tickets to get that "low-hanging fruit", for those cases
that just need a few small changes in their existing assignment
operators. I'd rather wait and see if those simple cases are going well
(especially at the regression site). But feel free to create tickets for
those implicit assignment operators if you can't wait any longer. :-)
I've just submitted a ticket to Douglas, for boost::function:
https://svn.boost.org/trac/boost/ticket/2319 boost::function's copy
assignment operator is kinda interesting, because it currently does
copy-and-swap, while it still doesn't provide the strong guarantee. The
"function_assignment.patch" that I attached to #2319 should
significantly reduce the chance of having the assignment fail, but it
still won't provide the strong guarantee. I'm afraid that's the price of
small-object optimization.
Do you think that it would be okay in C++0X to have operator= overloaded
for by-value (copy-assignment) and by-rvalue-reference
(move-assignment)? Or would it be preferable in C++0X to have a
const-reference as copy-assignment argument?
Kind regards,
Niels
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk