Re: guard condition for a callable thingy, with THESE arguments

2016-05-15 Thread Ann W. Griffith via Digitalmars-d-learn
On Sunday, 15 May 2016 at 07:22:57 UTC, cy wrote: On Sunday, 15 May 2016 at 02:12:38 UTC, Ann W. Griffith wrote: use "Parameters" in the constraint or make a template that you can reeuse. This is what I've got going so far. Using static asserts to have clearer errors when an incorrect

Re: guard condition for a callable thingy, with THESE arguments

2016-05-15 Thread cy via Digitalmars-d-learn
On Sunday, 15 May 2016 at 02:12:38 UTC, Ann W. Griffith wrote: use "Parameters" in the constraint or make a template that you can reeuse. This is what I've got going so far. Using static asserts to have clearer errors when an incorrect callback is supplied. I'm not... sure storage class is

Re: guard condition for a callable thingy, with THESE arguments

2016-05-14 Thread Ann W. Griffith via Digitalmars-d-learn
On Sunday, 15 May 2016 at 01:59:15 UTC, cy wrote: I take callbacks on occasion, and I don't really care if they're a delegate, or a function, or a callable object, and I can assert that in a template: void foo(Callable)(Callable callback) if(isSomeFunction!Callable || isCallable!Callable) {

guard condition for a callable thingy, with THESE arguments

2016-05-14 Thread cy via Digitalmars-d-learn
I take callbacks on occasion, and I don't really care if they're a delegate, or a function, or a callable object, and I can assert that in a template: void foo(Callable)(Callable callback) if(isSomeFunction!Callable || isCallable!Callable) { ... } That works, but it doesn't show you what