Re:Final features of C++17
by hellofunk on Friday July 01, 2016 @10:26AM
(#12016249)
The implementation of variant in C++17 is very different than in Boost. The Boost variant has a double buffer for the entire variant, and one of these buffers is always kept on the heap even if your variant is on the stack! This acts as a safety net incase the changing of the variant's value were to throw, you can get the old value back.
This implementation did not fly for C++'s goal of being high performance, and thus the new standardized variant is done quite differently.
This implementation did not fly for C++'s goal of being high performance, and thus the new standardized variant is done quite differently.