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

          Issue ID: 14670
           Summary: Allow Algebraic to ascribe names to fields
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: [email protected]
          Reporter: [email protected]

Algebraic should allow access to its constituents by name, just like Tuple
does. Example:

alias JsonPayload = Algebraic!(
    bool,
    double,
    long,
    string,
    This[],
    This[string]
);

Instead of using get!bool, get!(This[string]) or get!0, get!5 etc., definition
should allow inserting names for each:

alias JsonPayload = Algebraic!(
    bool, "asBool"
    double, "asDouble",
    long, "asLong",
    string, "asString",
    This[], "asArray",
    This[string], "asObject"
);

--

Reply via email to