Make a variable single-assignment?

Jesse Phillips Jesse.K.Phillips at gmail.com
Mon Nov 21 12:06:00 PST 2011


What you are describing is Head Const, and is not available.

http://www.d-programming-language.org/const-faq.html#head-const

It will not be added as it doesn't provide any guarantees about the code that is useful to the compiler. It can't be added to the existing system without complicating the type system even more, which outweighs the benefits.

Tail Const, a more useful direction has been shafted for much the same reason. There is however a pull request to add support into the compiler.


More information about the Digitalmars-d-learn mailing list