Re:Std::visit is everything wrong with modern C++ (2017)
by eMSF on Saturday December 05, 2020 @10:43AM
(#25315337)
You don't see how variants improve readability over union+tag? Do you mean that you don't see a whole lot of difference below:
Compared with something like:
[ Parent
| on HN ]
Re:Std::visit is everything wrong with modern C++ (2017)
by socialdemocrat on Sunday December 06, 2020 @07:15AM
(#25323017)
Looks like you are making things deliberately complicated. Here is an existing Variant type which existed long before modern C++ and which is easy to use: https://doc.qt.io/qt-5/qvariant.html