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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 24 11:53:00 PDT 2014


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

Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com

--- Comment #4 from Jonathan M Davis <jmdavisProg at gmx.com> ---
(In reply to Manu from comment #2)
> I don't think your example represents the 'general case'.

I think that in most cases, when the term "general case" is used, it means more
along the lines of every case or the "generic" case, not necessarily the common
case.

Regardless, we can potentially make it so that the compiler is able to infer
the constructor's template arguments for templated types in some basic cases,
but I think that it's clear that we can only do it for a certain subset.
Ultimately, you need a wrapper function to do the IFTI for you (like
redBlackTree) if you want to get full IFTI with templated types with templated
constructors.

--


More information about the Digitalmars-d-bugs mailing list