Flags ===== .. cpp:class:: numpy::Flags numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use Flags Flags obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``Flags() = default`` - df_flags.h:35 - * - ``Flags(const Flags&) = default`` - df_flags.h:50 - * - ``Flags(Flags&&) = default`` - df_flags.h:55 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void reset()`` - void - df_flags.h:85 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-flags-reset-0: .. dropdown:: reset (np_test_2_all.cpp:22610) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 22600 :emphasize-lines: 11 // Count iterations size_t outer_count = 0; size_t total_inner_count = 0; for (; !outer.is_finished(); ++outer) { size_t inner_count = 0; for (; !inner.is_finished(); ++inner) { inner_count++; total_inner_count++; } outer_count++; inner.reset(); } if (outer_count != 3 || total_inner_count != 12) { std::cout << " [FAIL] : Iteration counts incorrect"; throw std::runtime_error("np_test_nested_iters_basic failed"); } std::cout << " -> tests passed" << std::endl; }