Overload Maybe::operator=() to match all copy constructors.
Previously we depended on the compiler to implicitly invoke the copy constructor followed by the assignment operator, but this can lead to the compiler making surprising decisions in some cases, such as deciding that the literal 0 is a better match for nullptr than for T. Overloading operator=() to match every copy constructor is the safe thing to do.
Showing
Please
register
or
sign in
to comment