Boost logo

Boost Users :

From: Rainer Deyke (rdeyke_at_[hidden])
Date: 2021-04-09 05:14:22


On 08.04.21 23:45, Edward Diener via Boost-users wrote:
> If you just have:
>
> #include <boost/variant.hpp>
> #include <string>
>
> boost::variant<__int128, char, std::string> v;
> v = 56;
>
> This produces an error:
>
> ..\..\../boost/variant/variant.hpp:1578:38: error: call of overloaded
> 'initialize(void*, boost::move_detail::remove_reference<int&>::type)' is
> ambiguous

That's because it /is/ ambiguous. The compiler does not know if you
want to set the variant to a '__int128' or to a 'char'. You get the
same error message if you substitute 'long' for '__int128'.

-- 
Rainer Deyke (rainerd_at_[hidden])

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net