D const design rationale
sean at f4.ca
Wed Jun 27 13:05:50 PDT 2007
Robert Fraser wrote:
> I think the implementation is all right, I just think the syntax needs to be reconsidered. Personally, I think the whole const-final-invariant thing is quite a bit nicer than any other implementation I've seen: being able to mark an object as invariant makes writing threadsafe code a lot easier. If there was a way to mark a class/struct as "invariant after being constructed," then it'd be unbeatable.
Frankly, I expect to be casting stuff to invariant constantly, based on
the current design.
More information about the Digitalmars-d