[optional] new assignmet semantic and references
{This is copy of a message on the developers list that needs attention from
Boost.Optional Users}
Hello people,
A few days ago, a problem with Boot.Optional's assignment not properly
handling aliasing scenarios (like self assignment) was pointed out. We
concluded that the solution was to use T's operator=() directly instead of
the Destroy+Construct pattern that I was using.
I changed the code, tested it, and I was updating the documentation when I
recalled the following long-standing issue:
Currently, with the Destroy+Construct pattern, references are re-bound in
case of assignment:
int a = 123 ;
int b = 456 ;
int& ra = a ;
int& rb = rb ;
optional
participants (1)
-
Fernando Cacciola