For reference, the TaggedAlgebraic struct that I wrote some time ago
supports this: https://github.com/s-ludwig/taggedalgebraic
You could do something similar to this:
struct Option(T) {
struct Kinds(T) {
typeof(null) none;
T some;
}
TaggedAlgebraic!Kinds data;
alias data this;
struct Some(T){
T value;
}
struct None{}
struct Option(T){
alias OptionAdt(T) = Algebraic!(Some!T, None);
OptionAdt!T value; //Should default to none
//OptionAdt!T value = OptionAdt!T(None());
/*
Error: memcpy cannot be interpreted at compile time,
because it has no