www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1178] New: templates - deduction + specialization won't compile

reply d-bugmail puremagic.com writes:

           Summary: templates - deduction + specialization won't compile
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: leo.dahlmann gmail.com

The following code won't compile with these error messages:

templates.d(11): template templates.test!(double).foo(T) does not match any
late declaration
templates.d(11): template templates.test!(double).foo(T) cannot deduce template
function from argument types (double,char[2])

template test(R)
        R foo(T)(float x, T param)
                return cast(R)x;

void main()
        test!(double).foo(5.0, "hi");

Apr 23 2007
parent d-bugmail puremagic.com writes:

thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

------- Comment #1 from thomas-dloop kuehne.cn  2007-04-27 12:35 -------
use "5.0f" in istead of "5.0"

*** This bug has been marked as a duplicate of 617 ***

Apr 27 2007