Hi,
I've just got an error I would think impossible with variant: assigning
another variant to it triggered the false assert at
/usr/include/boost/variant/detail/visitation_impl.hpp:203
which, IIUC, seems to say that there is a lack of a fallback type...
FWIW, it's a variant holding 3 types, an int and 2 pointers types. When
the error occurs, it's in the copy constructor of an object holding such
a variant, and at this moment, the rhs variant holds it's third type,
the second pointer type.
The exact error is, at runtime (compilation goes without a warning):
/usr/include/boost/variant/detail/visitation_impl.hpp:203: typename Visitor::result_type boost::detail::variant::visitation_impl(int, int, Visitor&, VPCV, mpl_::true_, NBF, W*, S*) [with W = mpl_::int_<20>, S = boost::detail::variant::visitation_impl_stepboost::mpl::l_end, boost::mpl::l_iterboost::mpl::l_end >, Visitor = boost::variant::node_iterator*, twotypestree::tree::leaf_iterator*, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::assigner, VPCV = const void*, NBF = boost::variant::node_iterator*, twotypestree::tree::leaf_iterator*, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::has_fallback_type_]: Assertion `false' failed.
- twotypestree::tree is a tree holding a different data at it's
nodes (T1 here) and it's leafs (T2* here).
- twotypestree::tree_placeholder is an enum with just a value,
not_a_tree
The code triggering the problem is as simple as:
tree_iterator(const tree_iterator& original)
{
pimpl_ = original.pimpl_; // pimpl_ is the variant
}
Would anyone see what the problem is?
Confusingly,
Nowhere man
--
nowhere.man@levallois.eu.org
OpenPGP 0xD9D50D8A