Const Ideas
Christopher Wright
dhasenan at gmail.com
Mon Dec 3 11:45:59 PST 2007
Craig Black wrote:
> If that is correct, then transitivity just seems like an artificial
> restriction for no reason. It's not like we are violating some fundamental
> law here. I still don't see a good reason not to allow "C const c" syntax.
> To me, it's straightforward. However, it may complicate the compiler
> implementation. I wouldn't know.
You're right in that it's an artificial restriction.
As for complicating the implementation, I doubt that. It should be
easier to do head-const than transitive const. You have to arrange for
an initial assignment, which could be awkward.
The main issue is language bloat, I think. This is a common feature of
other languages, though, so that in itself is an argument in favor of
considering the feature. And the fact that it can help find local bugs
is an argument in favor of implementing it.
I think people have been expecting const always to give a rebindable
reference for reference types, and then wanting final in addition.
Maybe. But I'm not sure.
More information about the Digitalmars-d
mailing list