On Tuesday, 26 February 2019 at 12:52:11 UTC, JN wrote:
On Monday, 25 February 2019 at 20:31:43 UTC, Paul Backus wrote:
SumType is a generic sum type for modern D. It is meant as an alternative to
`std.variant.Algebraic`.

Is it a better alternative? Seems like it from the description. If it's objectively better on all fronts, perhaps it should be considered for inclusion into Phobos, as a replacement for the existing Algebraic?

It's not a perfect superset of Algebraic and Variant in Phobos, so it's not a strictly better alternative. The feature that is missing is SumType can't hold arbitrary types, only the types specified in its template parameters. However, for the case where the set of possible types is limited, it's strictly better.

--
  Simen

Reply via email to