Structural exhaustive matching

weaselcat via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 21 09:21:27 PDT 2015


On Tuesday, 21 April 2015 at 15:36:28 UTC, 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.

D's ADTs are in std.variant, the equivalent of matching is the 
.visit property AFAIK


More information about the Digitalmars-d-learn mailing list