pure or not pure?

guslay guslay at gmail.com
Wed Apr 9 14:38:44 PDT 2008


Steven Schveighoffer Wrote:
> 
> 1. Can pure functions use mutable heap data?  If so, what are the 
> restrictions for this?
> 
> i.e.:
> pure char[] f(int x, int y)
> {
>    char[] c = new char[y];
>    c[] = (char)x;
> }

Isn't the dynamic allocator a global state?





More information about the Digitalmars-d mailing list