uTL
micro Template library
iterators.h
Go to the documentation of this file.
1 
21 #ifndef __utl_concepts_iterator_h__
22 #define __utl_concepts_iterator_h__
23 
24 #include <utl/core/impl.h>
25 #include <utl/concepts/defines.h>
26 #include <utl/concepts/stl.h>
27 
32 namespace utl {
34 
35  #if CXX_CONCEPTS
36  template <class I>
38  Semiregular<I> &&
39  requires(I i) {
40  { ++i } -> Same<I>&; // not required to be equality preserving
41  i++; // not required to be equality preserving
42  };
43  #else
44  namespace detail {
45  template <typename I> using try_ppI = decltype (++(std::declval<I>()));
46  template <typename I> using try_Ipp = decltype (std::declval<I>()++);
47  }
48  template <class I>
50  Semiregular<I>
53  #endif
54 
55  #if CXX_CONCEPTS
56  template <class I>
57  _utlConcept DeviceIterator =
58  requires(I i) {
59  { *i } -> auto&&; // Requires: i is dereferenceable
60  } &&
61  WeaklyIncrementable<I>;
62 
63  #else
64 
65  #endif
66 
67 }
68 
70 #endif /* __utl_concepts_iterator_h__ */
#define _utlConcept
utl concept keyword syntax wrapper
Definition: defines.h:56
_utlConcept WeaklyIncrementable
Definition: iterators.h:49
STL&#39;s Concepts.
Concepts defines.
STL&#39;s core language concepts.
Definition: _1wire.h:30
eval< detail::detector< nat_, void, Op, Args... > > detected_t
Definition: detection.h:146
decltype(std::declval< I >()++) try_Ipp
Definition: iterators.h:46
decltype(++(std::declval< I >())) try_ppI
Definition: iterators.h:45
typename detail::detector< nat_, void, Op, Args... >::detected is_detected
Definition: detection.h:118
Implementation detail main forward header.