| Taskflow: A General-purpose Task-parallel Programming System

Loading...
Searching...
No Matches
tf::InputIteratorLike Concept Reference

concept to check if a type is a stateful input iterator More...

`#include <taskflow/utility/iterator.hpp>`

## Concept definition

template<typename T>
concept tf::InputIteratorLike = std::input_iterator<std::decay_t<std::unwrap_ref_decay_t<T>>>
tf::InputIteratorLike
concept to check if a type is a stateful input iterator
Definition iterator.hpp:1065

## Detailed Description

concept to check if a type is a stateful input iterator

Satisfied by any type that, after unwrapping a possible `std::reference_wrapper` and applying `std::decay_t`, models `std::input_iterator`.

This allows APIs to accept:

- an input iterator,
- a reference to an input iterator, or
- a `std::reference_wrapper` of an input iterator (e.g., from `std::ref`),

enabling the iterator value to be supplied either directly or indirectly.

using Iter = std::vector<int>::iterator;
static_assert(tf::InputIteratorLike<Iter>);
static_assert(tf::InputIteratorLike<Iter&>);
static_assert(tf::InputIteratorLike<std::reference_wrapper<Iter>>);
static_assert(!tf::InputIteratorLike<int>);
static_assert(!tf::InputIteratorLike<std::reference_wrapper<int>>);