MCPcopy Create free account
hub / github.com/pybind/pybind11 / contains

Method contains

include/pybind11/pytypes.h:2328–2334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2326 bool empty() const { return size() == 0; }
2327 template <typename T>
2328 bool contains(T &&val) const {
2329 auto result = PySet_Contains(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr());
2330 if (result == -1) {
2331 throw error_already_set();
2332 }
2333 return result == 1;
2334 }
2335};
2336
2337class set : public anyset {

Callers

nothing calls this directly

Calls 2

ptrMethod · 0.80
object_or_castFunction · 0.70

Tested by

no test coverage detected