Почему при копировании foo
экземпляр выдает ошибку:
error: call of overloaded 'convert_construct(foo&, long int)' is ambiguous
?
#include <iostream>
#include <string>
#include <boost/variant.hpp>
struct foo : public boost::variant<int, std::string>
{
using boost::variant<int, std::string>::variant;
};
int main()
{
foo f(111);
// auto g = f; // ERROR -> call of overloaded 'convert_construct(foo&, long int)' is ambiguous
}
Пример в реальном времени: cpp.sh / 7f3xy