Bug 14670 – Allow Algebraic to ascribe names to fields

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-09T17:15:54Z
Last change time
2024-12-01T16:24:37Z
Assigned to
No Owner
Creator
Andrei Alexandrescu
Moved to GitHub: phobos#9661 →

Comments

Comment #0 by andrei — 2015-06-09T17:15:54Z
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" );
Comment #1 by robert.schadek — 2024-12-01T16:24:37Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9661 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB