Symbol lookup rules and imports

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 2 17:11:52 PST 2014


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.

-Steve




More information about the Digitalmars-d mailing list