.. index:: py::builtins::all .. _doxycast_pypp_namespacepy_1_1builtins_1aababc384bd20f2d57338abdda4f0aea5: .. _py-builtins-all: *py::builtins::*\ all ===================== *Defined at* ```` .. code-block:: cpp template constexpr bool all(const type& iterable); Checks whether every element of an array is ``true``. .. note:: Calling this function is equivalent to the following: .. code-block:: cpp iterable[0] && iterable[1] && iterable[2] && ... Template parameters ------------------- ``type``: The type of iterable object. .. admonition:: Requirements of ``type`` ``type`` must iterable with for loop and elements stored by the iterable object must be ``bool`` or implicitly convertable to ``bool``. Parameters ---------- ``iterable``: An iterable object. Return value ------------ Whether every element of the iterable is ``true``. Complexity ---------- Linear in the size of ``iterable`` at most. Example ------- .. code-block:: cpp #include #include #include int main() { py::list a = {true, true}; py::print(py::all(a)); } **Output**: .. code-block:: text true