boost::get<T>(boost::optional<T> ...) overload matches for a non-boost::optional type when boost namespace is associated with argument's type of unqualified call to get<T>.
template <typename U>
structX {};
template <typename T, typename U>
inlineintget(X<U> const&) { return0; }
namespaceboost {
structany_type_in_boost_namespace {};
}
#include<boost/optional.hpp>classtag;
intmain()
{
get<tag>(X<boost::any_type_in_boost_namespace>{});
}https://godbolt.org/z/14d476
The example obviously should compile, but instead it tries to instantiate boost::optional<tag> and fails the compilation.
boost::get<T>(boost::optional<T> ...)overload matches for a non-boost::optionaltype when boost namespace is associated with argument's type of unqualified call toget<T>.https://godbolt.org/z/14d476
The example obviously should compile, but instead it tries to instantiate
boost::optional<tag>and fails the compilation.