What is the difference? (D2)

Koroskin Denis 2korden at gmail.com
Mon Jul 28 17:38:09 PDT 2008


On Mon, 28 Jul 2008 13:24:12 +0400, Dave B. <nospam at thankyou.com> wrote:

> Using them as parameter modifiers in functions, what is the difference  
> between "in", "const" and "final"?
>
> e.g.
>
> void func(final int i)
> {...}
>
> vs
>
> void func(in int i)
> {...}
>
> vs
>
> void func(const int i)
> {...}
>
> Thanks

in, out and inout are explained here very well:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.learn&artnum=6440

in - is a do-nothing modifier, since it is a default behaviour.
const - variable is a constant value in the function scope. D2 only
final - not supported. use const instead



More information about the Digitalmars-d mailing list