Andrei Alexandrescu wrote:
> If we want to allow people to create ranges that are classes (as opposed
> to structs) the requirement for a save() function is a must. This is
> because copying class ranges with
> 
> Range copy = original;
> 
> only creates a new alias for original; the two share the same state.

Allowing ranges to have either value or reference semantics is a
disaster, because it turns two very common and very obvious operations
(assignment and argument passing) into implementation-defined behavior.
I prefer value semantics over reference semantics, but using either one
consistently would be infinitely preferable over leaving the choice to
the implementor.


-- 
Rainer Deyke - [email protected]

Reply via email to