4 ms·
There is a point, but it is overstretched. make_overloads is actually a cool trick. Yes, it would be nice if there was a version of this in the standard libra
by mlang23 6y ago
There is a point, but it is overstretched. make_overloads is actually a cool trick. Yes, it would be nice if there was a version of this in the standard library, but then again, it is just a few lines of magic. That will not be the first lines of magic in your C++ codebase.
If you compare the sum type and pattern matching story with modern languages, sure, you will find C++ is lacking. And it is. However, such a comparison is ignoring history.
I actually like variant. It is the best sum type we have in C++.