'''D module main; import std.stdio; import std.functional; template foo(alias predicate) if (is(typeof(unaryFun!predicate))) { alias notfunny=unaryFun!predicate; auto foo(Range)(Range range) if (isInputRange!(Unqual!Range)){ foreach(x; range) notfunny(x); return range;} } int main() { int[] lolo = [12, 66, 654, -98, 54]; lolo.foo(a=>a+2); lolo.writeln; return 0; } '''
I tried to make a template that receive lambda expression to
apply it on a given range the user specifies, but I found
non-understood problem:
- Obsecure problem 2 pascal111 via Digitalmars-d-learn
- Re: Obsecure problem 2 jfondren via Digitalmars-d-learn
- Re: Obsecure problem 2 pascal111 via Digitalmars-d-learn
- Re: Obsecure proble... jfondren via Digitalmars-d-learn
- Re: Obsecure pr... pascal111 via Digitalmars-d-learn