'final' variables

Stewart Gordon smjg_1998 at yahoo.com
Tue Mar 20 08:29:33 PDT 2007


Tyler Knott Wrote:
> Lionello Lunesu Wrote:
>> What's the use of "final" for variables?  I'm saying "for 
>> variables" because for methods the benefit is only too clear.
> 
> Because the "const" keyword is being repurposed for read-only 
> references to mutable or non-mutable data, we need a new 
> keyword for non-mutable variables.
<snip>

C++ manages with const for both, so why can't D?  What circumstance is there in which either keyword would be valid with different meanings?

Stewart.



More information about the Digitalmars-d mailing list