11 #ifndef NESTEDITERATOR_H
12 #define NESTEDITERATOR_H
15 #include <type_traits>
25 template <
typename T,
bool>
30 -> decltype(
typename T::const_iterator(),
bool());
42 <T, details::type_traits::has_const_iterator_helper((T*)(nullptr))>
83 template <
typename CITER,
typename INNERCONTEXTRACT>
99 template <
typename T,
bool>
100 struct has_const_iterator_struct:
public std::false_type {};
102 template <
typename T>
107 template <
typename T>
109 -> decltype(
typename T::const_iterator(),
bool())
152 template <
typename ITER,
typename INNERCONTEXTRACT>
153 class deep_const_fwd_iterator_nested:
public std::forward_iterator_tag {
160 =
typename InnerContainer_t::const_iterator;
211 template <
class CONT>
232 template <
class CONT>
309 const typename InnerContainerExtractor_t::result_type&
320 template <
typename ITER,
typename INNERCONTEXTRACT>
324 outer_iter(src), outer_end(end)
326 if (is_end())
return;
332 template <
typename ITER,
typename INNERCONTEXTRACT>
341 template <
typename ITER,
typename INNERCONTEXTRACT>
352 template <
typename ITER,
typename INNERCONTEXTRACT>
354 inner_iter =
std::begin(extract_container(*outer_iter));
355 inner_end =
std::end(extract_container(*outer_iter));
359 template <
typename ITER,
typename INNERCONTEXTRACT>
361 { inner_end = inner_iter = {}; }
363 template <
typename ITER,
typename INNERCONTEXTRACT>
365 while(inner_iter == inner_end) {
380 template <
typename CITER,
typename INNERCONTEXTRACT>
390 #endif // NESTEDITERATOR_H
deep_const_fwd_iterator_nested(const CONT &cont, EndPositionTag)
Constructor: starts from the end of the specified container.
deep_const_fwd_iterator_nested()=default
Default constructor: invalid iterator.
typename InnerIterator_t::value_type value_type
Type of the value pointed by the iterator.
InnerIterator_t inner_iter
points to the current element
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
result_type & operator()(argument_type &x) const
result_type & operator()(argument_type &p) const
process_name opflash particleana ie x
typename InnerContainer_t::const_iterator InnerIterator_t
const InnerContainerExtractor_t::result_type & extract_container(const typename OuterIterator_t::value_type &v)
Extracts the value out of the inner iterator.
INNERCONTEXTRACT InnerContainerExtractor_t
iterator_type operator++(int)
Postfix increment operator: points to the next element.
InnerIterator_t inner_end
stores the end of current inner container
OuterIterator_t outer_iter
points to current inner container
deep_const_fwd_iterator_nested(OuterIterator_t end)
Internal constructor: past-the-end iterator pointing to specified place.
iterator_type & operator++()
Prefix increment operator: points to the next element.
const value_type & operator*() const
auto end(FixedBins< T, C > const &) noexcept
bool operator!=(const iterator_type &as) const
Returns true if the two iterators are not equivalent.
void swap(iterator_type &with)
Swaps this with the specified iterator.
Functor returning the object specified as argument.
deep_const_fwd_iterator_nested< OuterIterator_t, InnerContainerExtractor_t > iterator_type
auto begin(FixedBins< T, C > const &) noexcept
constexpr auto has_const_iterator_helper(T *=nullptr) -> decltype(typename T::const_iterator(), bool())
bool operator==(const iterator_type &as) const
OuterIterator_t outer_end
points to past-the-end inner container
Internal helper class: actual implementation of nested iterator.
deep_const_fwd_iterator_nested(const CONT &cont, BeginPositionTag)
Constructor: starts from the beginning of the specified container.
const value_type & operator->() const
typename InnerContainerExtractor_t::result_type InnerContainer_t
T::second_type result_type
static constexpr EndPositionTag end
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
static constexpr BeginPositionTag begin
void skip_empty()
points to the next item