I think this is a Boost bug.
type requirements :
- CopyConstructible or MoveConstructible.
- The destructor maintains a no-throw safety guarantee.
- . (.
boost::recursive_wrapper<T>
, .)
:
- EqualityComparable:
variant
EqualityComparable , .
, , . , . , , ,:
template <typename T>
bool operator()(const T& rhs_content) const
{
known_get<const T> getter;
const T& lhs_content = lhs_.apply_visitor(getter);
return Comp()(lhs_content, rhs_content);
}
const T
. , , known_get
, :
T& operator()(T& operand) const BOOST_NOEXCEPT
{
return operand;
}
template <typename U>
T& operator()(U& ) const
{
// logical error to be here: see precondition above
BOOST_ASSERT(false);
return ::boost::detail::variant::forced_return<T&>();
}
int&
:
const int& operator()(const int& ) const;
const int& operator()(int& ) const; [ U = int ]
, , , const-, . , . !
const
comparer
:
template <typename T>
bool operator()(T& rhs_content) const
{
known_get<T> getter;
T& lhs_content = lhs_.apply_visitor(getter);
return Comp()(lhs_content, rhs_content);
}
, const
.