Вопрос по c++ – Зачем мне нужны операторы сравнения в пакете векторной индексации Boost Python?

6

Error: User Rate Limit Exceeded

std::vector<A>

Error: User Rate Limit Exceeded

class A{};

Error: User Rate Limit Exceeded

BOOST_PYTHON_MODULE(libmyvec)
{
  using namespace boost::python;
  class_<A>("A");
  class_<std::vector<A> >("Avec")
    .def(boost::python::vector_indexing_suite<std::vector<A> >());
}

Error: User Rate Limit Exceeded

class A {
public:
  bool operator==(const A& other) {return false;}
  bool operator!=(const A& other) {return true;}
};

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededvector_indexing_suiteError: User Rate Limit Exceeded

Ваш Ответ

1   ответ
5

vector_indexing_suiteError: User Rate Limit Exceeded__contains__Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededfindError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

namespace indexing {
  template<>
  struct value_traits<A> : public value_traits<int>
  {
    static bool const equality_comparable = false;
    static bool const lessthan_comparable = false;
  };
}

Error: User Rate Limit ExceededError: User Rate Limit Exceeded.

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededsandbox? Hans

Похожие вопросы