25 #ifndef BOLT_ITERATOR_ADAPTOR_H
26 #define BOLT_ITERATOR_ADAPTOR_H
28 #include <type_traits>
29 #include <bolt/cl/detail/type_traits.h>
30 #include <bolt/cl/iterator/iterator_facade.h>
31 #include <bolt/cl/iterator/iterator_categories.h>
32 #include <bolt/cl/iterator/facade_iterator_category.h>
144 template<
typename From,
typename To>
147 std::is_convertible<From, To>::value
148 , bolt::cl::detail::enable_type
161 template <
class T,
class DefaultNullaryFn>
163 : bolt::cl::detail::eval_if<
164 bolt::cl::detail::is_same<T, use_default>
166 , bolt::cl::detail::identity_<T>
189 , bolt::cl::detail::eval_if<
190 std::is_same<Reference,use_default>
192 , std::remove_reference<Reference>
208 , bolt::cl::detail::eval_if<
209 std::is_same<Value,use_default>
211 , bolt::cl::detail::add_reference<Value>
251 ,
class Value = use_default
252 ,
class Traversal = use_default
253 ,
class Reference = use_default
254 ,
class Difference = use_default
258 Derived, Base, Value, Traversal, Reference, Difference
265 Derived, Base, Value, Traversal, Reference, Difference
275 typedef Base base_type;
277 Base
const& base()
const
278 {
return m_iterator; }
287 Base
const& base_reference()
const
288 {
return m_iterator; }
290 Base& base_reference()
291 {
return m_iterator; }
300 typename super_t::reference dereference()
const
301 {
return *m_iterator; }
304 class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D
308 return m_iterator == x.base();
311 void advance(
typename super_t::difference_type n)
313 m_iterator += (int)n;
316 void increment() { ++m_iterator; }
318 void decrement() { --m_iterator; }
321 class OtherDerived,
class OtherIterator,
class V,
class C,
class R,
class D
323 typename super_t::difference_type distance_to(
326 return y.base() - m_iterator;
337 #endif // BOLT_ITERATOR_ADAPTOR_H