Alias std.variant.Algebraic
Algebraic data type restricted to a closed set of possible
types. It's an alias for VariantN with an
appropriately-constructed maximum size. Algebraic is
useful when it is desirable to restrict what a discriminated type
could hold to the end of defining simpler and more efficient
manipulation.
						
					
				Example
auto v = Algebraic!(int, double, string)(5);
assert(vExample
Self-Referential Types
A useful and popular use of algebraic data structures is for defining self-referential data structures, i.e. structures that embed references to values of their own type within.
This is achieved with Algebraic by using This as a placeholder whenever a
reference to the type being defined is needed. The Algebraic instantiation
will perform alpha renaming on its constituent types, replacing This
with the self-referenced type. The structure of the type involving This may
be arbitrarily complex.
import std