Template not seeming to instantiate a second time with default alias parameter
wobbles via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 31 12:39:49 PDT 2016
On Tuesday, 30 August 2016 at 21:35:29 UTC, ag0aep6g wrote:
> On 08/30/2016 11:28 PM, wobbles wrote:
>> I'll have to try find a workaround for now :/
>
> This seems to work and isn't too ugly:
>
> ----
> class Node(T, alias func) {/*...*/}
> alias Node(T) = Node!(T, (T t) => t*t);
> ----
Excellent - thanks for these.
This one will work for me :)
I was going to do something messy with a nested template and some
static ifs. But, complicated things are complicated. This is much
easier.
Thanks!
More information about the Digitalmars-d-learn
mailing list