Boost.Any vs. Boost.Variant

C++BoostBoost VariantBoost Any

C++ Problem Overview


I'm having trouble choosing between Boost.Any and Boost.Variant.
When should I use each one?

What are the advantages and disadvantages of each?

I am basically looking to store some states from external sources.

C++ Solutions


Solution 1 - C++

Have you looked at the comparison in the variant library already?

(Not sure what states from external sources are, so it's kind of hard to say what's more appropriate for you.)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionthe_drowView Question on Stackoverflow
Solution 1 - C++drbyView Answer on Stackoverflow