Template argument deduction and default args

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 00:06:25 PDT 2014


On 24/07/14 17:11, Manu via Digitalmars-d wrote:

> I didn't specify, and I don't think this code requires that I do.
>
> T will resolve this situation naturally.
> Is it 'template T(X)'? Obviously the type.
> Is it 'template T(alias X)'? this could be the type or the template, but
> since the template is more inclusive, it should be that. Within T's
> definition, if T is passed as the template, then the opportunity is
> retained to go either way as is necessary when the context becomes explicit.
> I actually think it works quite elegantly. What have I missed?

I'm pretty sure I've asked the same question as you did. I also got 
similar replays. To me it's quite simple. In every case it will be the 
template, as it is now. Except when called with arguments as a constructor.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list