vector_indexing_suite
implements the __contains__
member __contains__
, which requires an equality operator. As a result, your type should provide such an operator.
The sandware version of Boost.Python solves this problem by using traits to determine which operations are available for containers. For example, find
will only be provided if the values ββare equal to equal.
By default, Boost.Python assumes that all values ββare equal to comparable and less comparable. Since your type does not meet these requirements, you need to specialize functions to indicate which operations it supports:
namespace indexing { template<> struct value_traits<A> : public value_traits<int> { static bool const equality_comparable = false; static bool const lessthan_comparable = false; }; }
This is documented here .
source share