taggedalgebraic 0.11.0 adds TaggedUnion

Paul Backus snarwin at gmail.com
Sat Feb 23 19:19:57 UTC 2019


On Friday, 22 February 2019 at 17:09:41 UTC, Sönke Ludwig wrote:
>  - Behaves like a POD if only POD fields exist, is non-copyable 
> if any
>    contained type is non-copyable etc.

In fact, if a contained type is non-copyable, it fails to compile 
altogether. (Example code below.)

Granted, so do Algebraic and SumType, so this isn't a knock 
against taggedalgebraic in particular. But it does indicate poor 
test coverage that you listed this feature without realizing it 
didn't work.

--- example.d
/+ dub.sdl:
dependency "taggedalgebraic" version="~>0.11.2"
+/
import taggedalgebraic;

struct NoCopy { @disable this(this); }
union U { NoCopy member; }
alias Test = TaggedUnion!U; // kaboom

void main() {}



More information about the Digitalmars-d-announce mailing list