www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1780] New: Type tuple deduction failure for class templates


           Summary: Type tuple deduction failure for class templates
           Product: D
           Version: 2.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: paul_m_doc hotmail.com

Type arguments of class templates should be deducible with the following:

template Tuple(Ts ...) { alias Ts Tuple; }

template Decode( T )                            { alias Tuple!() Types; }
template Decode( T : TT!(Us), alias TT, Us... ) { alias Us Types; }

struct S2(T1, T2) {}

// should extract tuple (bool,short) but matches the first specialisation

alias Decode!( S2!(bool,short) ).Types SQ2;  // --> SQ2 is empty tuple!


Issue #1779 tries to workaround this failure by decoding a fixed number of
arguments but even that crashes the compiler.

Jan 10 2008