[Issue 13196] Infer struct/class template args from constructor args

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 28 07:13:51 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13196

--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The *general* rule should be, if I can make an IFTI function that simply
forwards to the ctor of the struct, then the compiler should simply allow it to
be called via the ctor as if the IFTI function existed.

Of course, there will be exceptions to the rule. Of course, it's not going to
be as flexible as IFTI, as you can decouple to some degree the return value of
an IFTI function, but you cannot do that with a templated struct/class.

But the things that would work should cover a lot of ground. If we can find
ways to tweak it upward, we can do that. But I think it's worth adding the
feature, even for the simple cases.

--


More information about the Digitalmars-d-bugs mailing list