Commit 596294a1 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[common][id] add inequality check

parent 537bc8e3
......@@ -61,6 +61,12 @@ public:
bool operator== (const Id& otherId) const
{ return id_ == otherId.get(); }
/*!
* \brief Inequality check.
*/
bool operator!= (const Id& otherId) const
{ return id_ != otherId.get(); }
private:
std::size_t id_;
};
......
......@@ -34,6 +34,7 @@ void registerId(py::module& module)
cls.def(py::init<std::size_t>());
cls.def("get", &Id::get, "return the id");
cls.def(py::self == Id());
cls.def(py::self != Id());
cls.def(hash(py::self));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment