My understanding of pure is that a function labeled pure can only include pure functions. I've been confused by the fact that a function calling map (like below) can be labeled pure without any problems. The only way I can rationalize it is that map really isn't a function, it's (if I'm understanding it correctly) a template that creates a template function that calls a struct template.

auto test_map(T)(T x) pure
{
        return x.map!(a => a + a);
}

This is related to
http://forum.dlang.org/thread/ppmokalxdgtszzllz...@forum.dlang.org?page=1
but maybe my question is more basic.

Reply via email to