On Thursday, 16 May 2013 at 18:30:22 UTC, Nick Sabalausky wrote:
On Fri, 10 May 2013 14:32:48 +0200
"deadalnix" <[email protected]> wrote:
http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/
A trick that I used to use more and more, so I ended up
creating a generic solution and wrote an article about it.
Nice article, but is there any particular problem with
std.variant.Algebraic?
Yes, : it is user responsibility to poll types and act
accordingly. In the presented code, this is the responsibility of
the data structure.
For instance, if I add a new type, with Algebraic, I'll have to
go over all my code base to patch every use. If I don't, my code
become silently incorrect. With the presented solution, I'll get
a compile time error.