Fully transitive const is not necessary

Georg Wrede georg at nospam.org
Sat Apr 5 15:27:29 PDT 2008


Janice Caron wrote:
> On 05/04/2008, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> 
>> In fact, to get technical,
>>it should be:
>>pure int f(invariant Class c);
> 
> 
> I wondered about that.
> 
> It seems to me that if /all/ of the parameters, /and/ the return value
> /must/ be invariant (or implicitly castable to invariant, e.g. int)
> then couldn't
> 
>     pure R f(A a, B b, C c, D d)
> 
> be syntactic sugar for
> 
>     pure invariant(R) f(invariant(A) a, invariant(B) b, invariant(C)
> c, invariant(D) d)
> 
> ? (Especially what with "invariant" being a nine-letter keyword and all!)

(OT) This shows how misleading the "transitive const" moniker is.

Obviously, we should name the topic "recursive invariant".



More information about the Digitalmars-d mailing list