On Sun, 03 Feb 2013 11:28:52 -0500, Steven Schveighoffer <[email protected]> wrote:

As for templates that return a templated type, it should be allowed, although the calling syntax would have to be for the explicit template call, since you can't do IFTI on return values. In other words:

template x(T) { @property T x(){return to!(T)(_x);} } // could be shortened to normal @property T x(T)()

auto xcopy = obj.x!(string).x;

Hm... I actually am changing my mind on this, you should be able to do:

auto xcopy = obj.x!(string);

For the simple reason that if @property is omitted, this would work (simple lack of parens). It makes no sense to make properties not have this ability.

-Steve

Reply via email to