
6 Mar
2009
6 Mar
'09
1:41 p.m.
I wrote:
So, an assign_to() API that won't ever move from an lvalue but will always try to with an rvalue also makes sense.. and it must be a member function nowadays to potentially move from rvalues.
Never mind that.. if for lvalues it *must* copy instead of move, it can't use swap(), then being a member function won't make any difference! I see now that's why you said that the third fucntion could be the free optional_assign_to() by Arno. Agreed on your list then:
for the time being I think that adding optional_move_to(T&) and optional_swap(T&) members (as I presented), and optional_assign (by Arno) should be sufficient.
Best -- Fernando Cacciola SciSoft Consulting, Founder http://www.scisoft-consulting.com