The two overloads (`in` and `in ref`) will conflict in the future.
To allow for `-preview=in` to be tested with many projects,
this simple fix can be applied. Later one, the overloads should
be merged into a single, `in` overload.
In cases where statically typed visitors need to be defined to avoid compile errors in a generic visitor, the generic one was still instantiated with the types already handled by the statically typed one(s), possibly resulting in a compile error.
Avoids template instantiation conflicts introduced by adding the second visit() in taggedalgebraic.taggedalgebraic. A compatibility alias is left in the taggedunion module to avoid breaking backwards compatibility.
Defines opDispatch as two levels of nested templates, so that the outer level only checks the member name to match any member defined by one of the contained types. This allows hasMember!TA to report proper values instead of always assuming `true`.
As a side-effect, `isOutputRange!(TA, T)` now only returns true, if any of the contained types is actually a matching output range.
Before this change, the alignment of TaggedAlgebraic was always 4, which in turn had a 50% chance of aligning 8-byte pointers on a non-8-byte boundary, causing the pointer to become invisible to the GC (and less bad, causing performance degradation when dereferencing the pointer). This would happen in particular when the total size of the TaggedUnion/TaggedAlgebraic was not divisible by 8 and an array of values was built.
- Add constructors and assignment operators for unique types
- Rename field getters to fooValue and value!() to enable sane property syntax and to avoid confusion when modifying the returned reference
- Fix misnomer "isUnionType" instead of "isUnitType"
TaggedUnion has a number of convenience features compared to TaggedAlgebraic that are possible because of the missing dynamic dispatch functionality. If the latter is not required, TaggedUnion provides a much less complex and more robust way to store a fixed set of types/kinds.