[Issue 5073] wrong file name in error message for "voids have no value" inside alias templates (affects std.algorithm.map)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 19 17:26:28 PDT 2011


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



--- Comment #4 from Rob Jacques <sandford at jhu.edu> 2011-05-19 17:22:16 PDT ---
Minor update to handle fixed sized arrays properly.

template map(fun...) {
    auto map(Range)(Range r) {
        static if (fun.length > 1) {
            return Map!(unaryFun!(adjoin!(staticMap!(unaryFun,fun))),Range)(r);
        } else {
            static if( is(typeof(fun[0]) == delegate) ) {
                return Map!(fun, Range)(fun[0],r);
            } static if( is(Range E:E[]) ) {
                return Map!(unaryFun!fun, E[])(r[]);
            } else {
                return Map!(unaryFun!fun, Range)(r);
            }
        }
    }
}

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


More information about the Digitalmars-d-bugs mailing list