3 ms·
> I think we are better off with boost than learning this new stuff. Is this not a relatively direct import from boost: http://www.boost.org/doc/libs/1_64
by pavon 9y ago
> I think we are better off with boost than learning this new stuff.
Is this not a relatively direct import from boost:
http://www.boost.org/doc/libs/1_64_0/doc/html/variant.html
I remember that being relatively painful to use 10 years ago.
- option_greek 9y agoWhich is why no one uses it. The good thing about boost is you get to evaluate features based on merit and be choosy. Putting these in the standard creates an expectation that developers be aware of how to use them.
- blub 9y agoI used it together with type() to read the variant's current type and act on that. The std::variant has a bit nicer API compared to boost with e.g holds_alternative. I expect I would create a make_visitor wrapper myself or use an open source one if needed, but it wasn't needed.