[Issue 14802] Template argument deduction depends on order of arguments

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 16 05:47:22 PDT 2015


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

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy at yahoo.com
         Resolution|---                         |INVALID

--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> ---
template deduction depends on "common type" deduction.

For two types that implicitly cast to each other, it has to make an arbitrary
decision. Same thing happens with 1, 1U.

However, when it cannot implicitly convert one to the other, the decision is to
use the one that both can accept. For example: 1, 1L yields the same type as
1L, 1.

--


More information about the Digitalmars-d-bugs mailing list