Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template indexed

boost::histogram::indexed — Generates a range over the histogram entries.

Synopsis

// In header: <boost/histogram/indexed.hpp>


template<typename Histogram> 
  auto indexed(Histogram && hist, coverage cov = coverage::inner);

Description

Use this in a range-based for loop:

for (auto x : indexed(hist)) { ... }

The iterators dereference to an indexed_range::accessor, which has methods to query the current indices and bins, and acts like a pointer to the cell value.

Parameters:

cov

Iterate over all or only inner bins (optional, default: inner).

hist

Reference to the histogram.


PrevUpHomeNext