iterators.h
Go to the documentation of this file.
#ifndef __utl_concepts_iterator_h__
#define __utl_concepts_iterator_h__
#include <utl/core/impl.h>
#include <utl/concepts/defines.h>
#include <utl/concepts/stl.h>
namespace utl {
#if CXX_CONCEPTS
template <class I>
_utlConcept WeaklyIncrementable =
Semiregular<I> &&
requires(I i) {
{ ++i } -> Same<I>&; // not required to be equality preserving
i++; // not required to be equality preserving
};
#else
namespace detail {
template <typename I> using try_ppI = decltype (++(std::declval<I>()));
template <typename I> using try_Ipp = decltype (std::declval<I>()++);
}
template <class I>
_utlConcept WeaklyIncrementable =
Semiregular<I>
&& Same<_ref_t<I>, meta::detected_t<detail::try_ppI, _ref_t<I>>>
&& meta::is_detected<detail::try_Ipp, _ref_t<I>>::value;
#endif
#if CXX_CONCEPTS
template <class I>
_utlConcept DeviceIterator =
requires(I i) {
{ *i } -> auto&&; // Requires: i is dereferenceable
} &&
WeaklyIncrementable<I>;
#else
#endif
}
#endif /* __utl_concepts_iterator_h__ */
_utlConcept
#define _utlConcept
utl concept keyword syntax wrapper
Definition: defines.h:56
utl::WeaklyIncrementable
_utlConcept WeaklyIncrementable
Definition: iterators.h:49
stl.h
STL&#39;s Concepts.
defines.h
Concepts defines.
utl
STL&#39;s core language concepts.
Definition: _1wire.h:30
utl::meta::detected_t
eval< detail::detector< nat_, void, Op, Args... > > detected_t
Definition: detection.h:146
utl::detail::try_Ipp
decltype(std::declval< I >()++) try_Ipp
Definition: iterators.h:46
utl::detail::try_ppI
decltype(++(std::declval< I >())) try_ppI
Definition: iterators.h:45
utl::meta::is_detected
typename detail::detector< nat_, void, Op, Args... >::detected is_detected
Definition: detection.h:118
impl.h
Implementation detail main forward header.