On Friday, 25 August 2017 at 00:35:24 UTC, jmh530 wrote:
What you seem concerned about here is how to produce a
meaningful error message for distribution that you do not have
implementations for. A slightly more elegant solution would be
to pack the structs into an AliasSeq and then use something
like !allSatisfies to test them all. I'm sure there's a more
elegant solution, but that's the first thing I thought of.
Andrei suggested allSatisfies that as an alternative approach to
a Union keyword similar to Julia, at the time I was still stuck
on how cool having a Union keyword like Julia's in D would be.
What you're looking for is an immutable constructor: