ReturnType of lambda templates
Roland Hadinger via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Aug 18 08:36:44 PDT 2015
On Tuesday, 18 August 2015 at 15:11:34 UTC, John Colvin wrote:
>
> for simple lambdas like that (i.e. function templates with one
> template arguments that corresponds to the type of the first
> and only argument), just add this template overload:
>
> auto apply( alias fun, T )( Nullable!T nullable )
> if( !isSomeFunction!fun )
> {
> return .apply!(fun!T, T)(nullable);
> }
>
> and it should work (give or a take a few typos on my part).
That was quick - and it works :)
Now, where is my thinking cap again?
More information about the Digitalmars-d-learn
mailing list