"Ali Çehreli" <[email protected]> wrote in message news:[email protected]... > Nick Sabalausky wrote: >> "Yigal Chripun" <[email protected]> wrote in message >> news:[email protected]... >>> uint a, b; // init to whatever >>> bool c, d; // ditto >>> >>> auto r1 = a AND b; // a & b >>> auto r2 = c AND d; // c && d >>> ... >>> AND stands for whatever *single* syntax is chosen for this. >>> >> >> Yuck, that amounts to language-enforced operator overloading abuse, just >> like the common mis-design of overloading '+' to mean both 'add' and >> 'concat'. > > That exists for the assignment operator too (which happens to be a > misnomer). > > lhs = rhs; > > may mean, without any user overloading: > > a) assign (destroy the value of lhs and copy the value of rhs) > > b) let lhs provide access to the same object that rhs is providing access > to (as a side effect, if lhs was the single reference to lhs's object, > then the object may be destroyed in the future) > > The behavior depends on whether the type is a value type or a reference > type. > > Ali
I've always seen "b" as just simply "a) assign" where the values being copied/destroyed are references instead of, say, chars or floats. Conversely, you can "a) assign" an int that's intended as an index into a collection and doing so amounts to "b". So that "a" and "b" essentially *are* the same.
