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

Method set

include/pybind11/pytypes.h:2340–2344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2338public:
2339 PYBIND11_OBJECT_CVT(set, anyset, PySet_Check, PySet_New)
2340 set() : anyset(PySet_New(nullptr), stolen_t{}) {
2341 if (!m_ptr) {
2342 pybind11_fail("Could not allocate set object!");
2343 }
2344 }
2345 template <typename T>
2346 bool add(T &&val) /* py-non-const */ {
2347 return PySet_Add(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr()) == 0;

Callers 1

dispatcherMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected