const(FAQ)

Regan Heath regan at netmail.co.nz
Mon Mar 31 07:14:54 PDT 2008


Unknown W. Brackets wrote:
> In my limited use of const thus far, I've found that "ignoring" or "just 
> not using" it is not as possible as suggested.  This is because the 
> standard library imposes it.
> 
> Or, in other words, if I ignore const and pretend it doesn't exist, 
> Phobos will wake me up from my sleep whenever I use a function that, 
> e.g. returns a string.

The return-type-has-const-of-parameter feature/idea should hopefully 
resolve this, as in, if you call split on a mutable string you get 
mutable slices, if you call it on an immutable string you get immutable 
slices.

Regan



More information about the Digitalmars-d mailing list