An idea to improve eponymous templates
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Apr 12 07:46:57 PDT 2012
On Thu, Apr 12, 2012 at 07:31:11PM +1000, Daniel Murphy wrote:
> "Jacob Carlborg" <doob at me.com> wrote in message
> news:jm66st$2d3f$1 at digitalmars.com...
> > On 2012-04-12 11:21, Daniel Murphy wrote:
> >
> >> Doesn't it need to be explicitly marked as a 'mixin template' for
> >> it to be mixed in?
> >>
> >>
> >
> > No, I don't think that is forced.
> >
> > --
> > /Jacob Carlborg
>
> Hmm. I guess the 'template' keyword is always available.
[...]
What about nested templates?
Or perhaps we can combine the keywords:
template MyTemplate(T) {
static if (SomeCond!T)
alias T this template;
else
static assert(0);
}
Clear, self-documenting, and unambiguous. :-)
T
--
"You know, maybe we don't *need* enemies." "Yeah, best friends are about all I can take." -- Calvin & Hobbes
More information about the Digitalmars-d
mailing list