Hi,
This introduces a level of abstractions for boost::variant
such that when we switch to C++17 we can drop in std::variant
instead and everything should work modulo the visitors.
The reason I went for a class and not a typedef/using like with Optional
is because I want to add the get
function so “users” won’t need to still include boost/variant/get.hpp
and because I wanted to make it more explicit when get
is throwing and when not (by splitting to get
and get_if
like stl does).
I also replaced the generic (Had to remove this since it broke a build, not sure if it’s because a specific boost version or a clang version https://travis-ci.org/bitcoin/bitcoin/jobs/638552502)boost/variant.hpp
with boost/variant/get.hpp
and boost/variant/variant.hpp
which are just 2 out of the 7 headers in boost/variant.hpp
(https://www.boost.org/doc/libs/1_71_0/boost/variant.hpp)