
25 Oct
2005
25 Oct
'05
5:12 p.m.
Fernando Cacciola wrote:
So you'd prefer:
o.reset()
to
o = none
?
Well, I guess that's depend on what with do with assigment.
If there's only copy assignment, 'o = none' looks consistent. If there is rebind(), reset() looks consistent.
I humbly disagree. I think that if there's no direct assignment from T, then there should also be no direct assignment from none (these two are symmetric, as they are the two possible options for the optional's content), and the only way to do it is by using reset()/clear(), or copy assignment from an empty optional. If there is direct T assignment, on the other hand, then none assignment should follow.