...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::histogram::indexed_range — Input iterator range over histogram bins with multi-dimensional index.
// In header: <boost/histogram/indexed.hpp> template<typename Histogram> class indexed_range { public: // types typedef unspecified iterator; typedef unspecified value_iterator; typedef unspecified value_reference; typedef unspecified value_type; // member classes/structs/unions // Lightweight view to access value and index of current cell. class accessor { public: // member classes/structs/unions // Array-like view into the current multi-dimensional index. class index_view { public: // types typedef unspecified const_iterator; typedef const axis::index_type & const_reference; // public member functions const_iterator begin() const noexcept; const_iterator end() const noexcept; std::size_t size() const noexcept; const_reference operator[](unsigned) const noexcept; const_reference at(unsigned) const; }; // construct/copy/destruct accessor(iterator &) noexcept; accessor(const accessor &) = default; accessor & operator=(const accessor &); template<typename T> accessor & operator=(const T &); // public member functions value_reference get() const noexcept; value_reference operator *() const noexcept; value_iterator operator->() const noexcept; axis::index_type index(unsigned = 0) const noexcept; index_view indices() const noexcept; template<unsigned N = 0> decltype(auto) bin(std::integral_constant< unsigned, N > = {}) const; decltype(auto) bin(unsigned) const; double density() const; bool operator<(const accessor &) noexcept; bool operator>(const accessor &) noexcept; bool operator==(const accessor &) noexcept; bool operator!=(const accessor &) noexcept; bool operator<=(const accessor &) noexcept; bool operator>=(const accessor &) noexcept; template<typename U> bool operator<(const U &) const noexcept; template<typename U> bool operator>(const U &) const noexcept; template<typename U> bool operator==(const U &) const noexcept; template<typename U> bool operator!=(const U &) const noexcept; template<typename U> bool operator<=(const U &) const noexcept; template<typename U> bool operator>=(const U &) const noexcept; operator value_type() const noexcept; }; // construct/copy/destruct indexed_range(histogram_type &, coverage); template<typename Iterable> indexed_range(histogram_type &, Iterable &&); // public member functions iterator begin() noexcept; iterator end() noexcept; };