Patterns for functions in template parameters

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 24 07:13:01 PDT 2014


On Fri, 24 Oct 2014 17:05:57 +0300
ketmar via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> On Thu, 23 Oct 2014 18:28:04 +0000
> Max Samukha via Digitalmars-d-learn
> <digitalmars-d-learn at puremagic.com> wrote:
> 
> um-hm... maybe this:
> 
>   void Foo(T, U) (T delegate (U) a) {
>     // here T is bool, U is int for the following sample
>     import std.stdio;
>     writeln(a(3));
>   }
> 
>   Foo((int x) => x%2 == 0);
sorry if this is not what you mean, template magic sometimes scares me
and i'm loosing my mind. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141024/2cf50542/attachment-0001.sig>


More information about the Digitalmars-d-learn mailing list