[Issue 18546] Improvement: Implicit Class Template Instantiation

2018-03-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18546

Steven Schveighoffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||schvei...@yahoo.com
 Resolution|--- |DUPLICATE

--- Comment #2 from Steven Schveighoffer  ---


*** This issue has been marked as a duplicate of issue 6082 ***

--


[Issue 18546] Improvement: Implicit Class Template Instantiation

2018-03-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18546

Jonathan M Davis  changed:

   What|Removed |Added

 CC||issues.dl...@jmdavisprog.co
   ||m
   Hardware|x86_64  |All
 OS|Linux   |All

--- Comment #1 from Jonathan M Davis  ---
The normal solution is to use a factory function which can then take advantage
of IFTI. As it stands, the compiler never does any implicit template
instantations except for functions, because for templates that aren't function
templates, it's ambiguous. This particular case is a bit special in that it's
using the type, not a function, but it's also triggering the constructor, which
_is_ a function. So, I don't know. Really, what it comes down to is that some
specific cases of implicitly instantiating templated types could be made to
work, but it can't work in the general case. So, thus far, the solution has
been to simply not support it.

Related: issue #1012.

--