Does anyone know if boost::get for boost::variant operator with high demand or not.
At the moment, I am refactoring old code in a performance-critical part where the “variant” is implemented by containers for each of the possible types and corresponding enum .
Obviously, this is fast, but ugly, and now, when I have to reorganize the code to work with another type , I want to get rid of this old part of the code and replace it with boost::variant .
In addition, I can’t just “profile both options and compare,” because this refactoring is a pain in the ass and will be quite laborious.
So, if someone knows how boost::get<x> performs a comparison with typical dispatching like enum-based , I would appreciate it if you share this knowledge.
There is another use case for boost::variant<types> with a user visitor (as described in the documentation of boost::variant ) - could it be faster than boost::get in my case?
Thanks.
c ++ performance boost variant
Yippie-ki-yay
source share