boost::variant only supports up to 20 types (MPL limit). boost::variant2 has no such limit; switch to it.