.. index:: py::builtins::operator ->* [py::builtins::in] .. _doxycast_pypp_namespacepy_1_1builtins_1af5317dcadb707a5a8dc1488617d98e61: .. _py-builtins-operator-pointer_to_member-in: *py::builtins::*\ operator ->* (:ref:`py::builtins::in `) ========================================================================= *Defined in* ```` .. code-block:: cpp template bool operator ->* (const element_t& element, const in& container); Returns whether a iterable object contains a value. Template parameters ------------------- ``element_t``: Type of the value to find. ``container_t``: Type of the container. Parameters ---------- ``element``: The value to find. ``container``: An ``py::builtins::in`` object referencing an iterable object. Return value ------------ Whether a iterable object contains a value. Complexity ---------- Linear in the size of ``container.container()``. Example ------- .. code-block:: cpp #include #include #include int main() { py::list nums = {0, 1, 2, 3, 4, 5, 6}; // Equivalent to ``4 in nums`` in Python py::print(4 ->* py::in(nums)); } **Output**: .. code-block:: text true