Variadic templates with aliases

Philippe Sigaud philippe.sigaud at gmail.com
Sat Dec 29 01:50:12 PST 2012


> I've myself written something like the first, but the second approach
> suits my needs better. typeof(this) is very nice.


It is. For mixin templates, it's a must.


> I intend to use it (among other things) for multivectors, so the scalar
> type is not directly obtainable from the parts, but then, I can allow
> partwise multiplication with whatever type the parts may multiply.


Yes, that can be tested at compile-time.


> The nicest thing about the two approaches is that they are orthogonal - a
> single template mixin may implement them both!
>

OK, great! Don't hesitate to ask if you're stuck.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20121229/5edc030a/attachment.html>


More information about the Digitalmars-d-learn mailing list