Thanks,
bryan
#include <boost/variant.hpp>
//A simplified wrapper
template<typename T>
struct wrap {
T t;
wrap(T& _t) : t(_t) {}
operator T() const {
return t;
}
T force() const {
return t;
}
};
struct A{}; struct B{};
typedef boost::variant<A, B> my_variant;
int main() {
A a;
my_variant x(a);
#ifndef WAR
my_variant y = wrap<my_variant>(x);
#else
my_variant y = wrap<my_variant>(x).force();
#endif
}
And the error:
/home/bcatanzaro/boost_1_53_0/boost/variant/variant.hpp:1574:9: error: no matching function for call to ‘boost::variant<A, B>::initializer::initialize(void*, std::remove_reference<wrap<boost::variant<A, B> >&>::type)’