2 ms·
> I am pretty lenient, and would go for anything that resembles a compiler-enforced tagged union http://www.boost.org/doc/libs/1_60_0/doc/html/variant.html htt
by GFK_of_xmaspast 11y ago
> I am pretty lenient, and would go for anything that resembles a compiler-enforced tagged union
http://www.boost.org/doc/libs/1_60_0/doc/html/variant.html http://www.boost.org/doc/libs/1_60_0/doc/html/variant.html ??? (and I think it's supposed to be coming in c++17)
- eru 11y agoThat's interesting, thanks! It seems this one discriminates the different possibilities by type, and not by some extra tag (like the constructor in Haskell's ADTs). I wonder how that works, if you want to write something like the `either' function (or even just write down its type in C++): either :: (a -> c) -> (b -> c) -> Either a b -> c