emlabcpp
modern opinionated embedded C++ library
enumerate.h
Go to the documentation of this file.
1 #pragma once
23 
24 #include "./zip.h"
25 
26 namespace emlabcpp
27 {
28 
29 template < typename Container >
30 auto enumerate( Container&& cont )
31 {
32  return zip( range( cont.size() ), cont );
33 }
34 
35 } // namespace emlabcpp
MIT License.
Definition: impl.h:31
auto zip(Ts &&... cont)
Creates a view of zip iterators for specified containers.
Definition: zip.h:151
constexpr view< iterators::numeric_iterator< Numeric > > range(Numeric from, Numeric to)
Builds numeric view over interval [from, to)
Definition: range.h:34
auto enumerate(Container &&cont)
Definition: enumerate.h:30