Structural exhaustive matching

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 21 11:11:51 PDT 2015


On 2015-04-21 17:36, Jadbox wrote:
> What's the best equivalent to Rust's structural enum/pattern (match)ing?
> Is it also possible to enforce exhaustive matches? Basically, I'm
> curious on what the best way to do ADTs in D.

There's something call "castSwitch" [1], perhaps not what you're looking 
for.

[1] http://dlang.org/phobos/std_algorithm_comparison.html#.castSwitch

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list