This is a preparation to change the implementation to std::variant. That will follow in a separate MR.