type checking and templates
Quote:
That is why I am against the use of references, for the sake of complete unambiguitiness and readability. I see no need for references at all.
I hope this only refers to non-const function parameters (and even then only when one is not looking at optimization). There are many situations (some described above) that require a reference return type, particularly when you desire lvalue status. And const references are preferred to enforce when you do not want block-relative copy semantics.
As for the compile-time type safety of policies, since templates are resolved at compile-time, it is a simple matter to invoke a template policy that will catch any undesired reassignments on any of my data types. Basically, any data I expose to a client can have a policy template typelist attached that will expose only those semantics I wish to allow (even defaults and assignments). In the second given case we are exploring (concerning passing by non-const referrence) I would send the data types that need to be manipulated wrapped up in a smart-pointer with a no-reference no-assignment policy attached. The design of such a policy could follow Stroustrup's point that "An Object may be explicitly converted to a reference type X& if a pointer to that object may be explicitly converted to an X*" although I think that an ambiguous resolver policy might be preferrable (as Mister Mai mentions at the end of his first paragraph).
The basic point is that I should not expose any objects to client programmers that do not have appropriate policies attached that would enforce my design goals. Objects created by the clients that do as described with operator+ would just mean I have bad coders for clients (and as pointed out above, does not rely on the referrence). I too can code badly if desired.