On Tue, 2 Dec 2014 17:33:09 -0800
"H. S. Teoh via Digitalmars-d" <[email protected]> wrote:

> On Tue, Dec 02, 2014 at 08:11:52PM -0500, Steven Schveighoffer via 
> Digitalmars-d wrote:
> > On 12/2/14 6:28 PM, H. S. Teoh via Digitalmars-d wrote:
> > 
> > >Technically, you *can* do that, but it's a lot more verbose (plus,
> > >ddoc doesn't know how to generate docs for eponymous templates
> > >properly and it looks ugly):
> > >
> > >   template method(R)
> > >   {
> > >           import std.range : isInputRange;
> > >
> > >           void method(R range)
> > >                   if (isInputRange!R)
> > >           { ... }
> > >   }
> > 
> > That works? I wouldn't expect it to, since the method inside the
> > template is not a template.
> [...]
> 
> Argh, you're right, that doesn't compile. The sig constraint has to be
> turned into a static if, which has different semantics, or attached to
> the template declaration, which defeats the purpose. :-(
heh, i was sure that this works too.

Attachment: signature.asc
Description: PGP signature

Reply via email to