[Issue 11818] New: Ternary operator not allowed in a value parameter anymore

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 25 16:16:57 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11818

           Summary: Ternary operator not allowed in a value parameter
                    anymore
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at erdani.com


--- Comment #0 from Andrei Alexandrescu <andrei at erdani.com> 2013-12-25 16:16:55 PST ---
This used to work:

enum E { e0, e1 }

struct SortedRange
{
    void fun(E e = true ? E.e0 : E.e1)()
    {
    }
}

void main(string[] args)
{
    SortedRange s;
    s.fun();
}

Now I get:

Error: expression true ? e0 : e1 is not a valid template value argument

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list