http://d.puremagic.com/issues/show_bug.cgi?id=5006



--- Comment #2 from bearophile_h...@eml.cc 2010-10-26 15:34:16 PDT ---
It seems currently (2.050alpha) nested functions can't be pure:


import std.traits: FunctionAttribute, functionAttributes;
void main() {
    static pure int foo1(int x) { return x; }
    pure int foo2(int x) { return x; }
    static assert(functionAttributes!(foo1) & FunctionAttribute.PURE); //
asserts
    static assert(functionAttributes!(foo2) & FunctionAttribute.PURE); //
asserts

}
void main() {}


This is a problem because I'd like many functions of std.algorithm to be weakly
pure. Many high order functions take an optional delegate argument, so if
there's no handy way to build a pure delegate, they become less useful.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to