CXXIter 0.2
Loading...
Searching...
No Matches
CXXIter::concepts::SourceContainer Concept Reference

Concept that checks whether the given TContainer is supported by CXXIter's standard source classes CXXIter::SrcMov, CXXIter::SrcRef and CXXIter::SrcCRef. More...

#include <Concepts.h>

Concept definition

template<typename TContainer>
TContainer& container,
const TContainer& constContainer,
typename trait::Source<TContainer>::IteratorState& iterState,
typename trait::Source<TContainer>::ConstIteratorState& constIterState,
size_t n
) {
typename trait::Source<TContainer>::IteratorState;
typename trait::Source<TContainer>::ConstIteratorState;
{trait::Source<TContainer>::initIterator(container)} -> std::same_as<typename trait::Source<TContainer>::IteratorState>;
{trait::Source<TContainer>::initIterator(constContainer)} -> std::same_as<typename trait::Source<TContainer>::ConstIteratorState>;
{trait::Source<TContainer>::hasNext(container, iterState)} -> std::same_as<bool>;
{trait::Source<TContainer>::hasNext(constContainer, constIterState)} -> std::same_as<bool>;
{trait::Source<TContainer>::next(container, iterState)} -> std::same_as<typename trait::Source<TContainer>::ItemRef>;
{trait::Source<TContainer>::next(constContainer, constIterState)} -> std::same_as<typename trait::Source<TContainer>::ItemConstRef>;
{trait::Source<TContainer>::peekNext(container, iterState)} -> std::same_as<typename trait::Source<TContainer>::ItemRef>;
{trait::Source<TContainer>::peekNext(constContainer, constIterState)} -> std::same_as<typename trait::Source<TContainer>::ItemConstRef>;
{trait::Source<TContainer>::skipN(container, iterState, n)} -> std::same_as<size_t>;
{trait::Source<TContainer>::skipN(container, constIterState, n)} -> std::same_as<size_t>;
}
Concept that checks whether the given TContainer is supported by CXXIter's standard source classes CX...
Definition: Concepts.h:16
static constexpr ItemRef next(TContainer &container, IteratorState &iter)
Return the next item in the iteration with the given iter state on the given container.
Definition: Traits.h:206
typename TContainer::value_type Item
Type of the item TContainer holds and provides for the iterator.
Definition: Traits.h:125
static constexpr ItemRef peekNext(TContainer &container, IteratorState &iter)
Return the next item in the iteration with the given iter state on the given container,...
Definition: Traits.h:224
static constexpr IteratorState initIterator(TContainer &container)
Return an initial IteratorState instance for iteration on the given container.
Definition: Traits.h:172
static constexpr bool hasNext(TContainer &container, IteratorState &iter)
Checks whether there is a next item in the iteration with the given iter state on the given container...
Definition: Traits.h:189
static constexpr size_t skipN(const TContainer &container, IteratorState &iter, size_t n)
Skip the next n elements from the container.
Definition: Traits.h:243
typename TContainer::reference ItemRef
Type of the item TContainer holds and provides for the iterator, in referenced form.
Definition: Traits.h:129
typename TContainer::const_reference ItemConstRef
Type of the item TContainer holds and provides for the iterator, in const referenced form.
Definition: Traits.h:133

Detailed Description

Concept that checks whether the given TContainer is supported by CXXIter's standard source classes CXXIter::SrcMov, CXXIter::SrcRef and CXXIter::SrcCRef.

The concept does these checks by testing whether the CXXIter::trait::Source was properly specialized for the given TContainer type.

See also
CXXIter::SourceTrait for further details on this.

Definition at line 16 of file Concepts.h.