What are the differences between std::variant and boost::variant?
Assignment/emplacement behavior: boost::variant may allocate memory when performing assignment into a live variant. There are a number of rules that govern when this can happen, so whether a boost::variant will allocate memory depends on the Ts it is instantiated with. std::variant will never dynamically allocate memory. However, as a concession to the complex rules of … Read more