const a storage class or a type modifier?

Trass3r un at known.com
Fri Nov 26 05:41:32 PST 2010


> Let's check all the possible cases:
> void foo(const int *non_const_ptr_to_const,
>          char *const const_ptr_to_non_const,
>          const float *const const_ptr_to_const);
>
> In D2 you cannot express char *const. That's due to the transitivity of
> const. You can only do a const char* which is a constant pointer to
> constant.
> That's why I think foo should become in D2
> void foo(const int*, char *, const(float*));

Don't you mean foo(const(int)*, char*, const float*)?


More information about the Digitalmars-d mailing list