2 * Copyright 2008-2013 NVIDIA Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 /*! \file normal_iterator.h
19 * \brief Defines the interface to an iterator class
20 * which adapts a pointer type.
25 #include <thrust/iterator/iterator_adaptor.h>
26 #include <thrust/iterator/detail/is_trivial_iterator.h>
27 #include <thrust/detail/type_traits.h>
35 template<typename Pointer>
37 : public iterator_adaptor<
38 normal_iterator<Pointer>,
42 typedef iterator_adaptor<normal_iterator<Pointer>, Pointer> super_t;
49 normal_iterator(Pointer p)
52 template<typename OtherPointer>
54 normal_iterator(const normal_iterator<OtherPointer> &other,
55 typename thrust::detail::enable_if_convertible<
59 : super_t(other.base()) {}
61 }; // end normal_iterator
64 template<typename Pointer>
65 inline __host__ __device__ normal_iterator<Pointer> make_normal_iterator(Pointer ptr)
67 return normal_iterator<Pointer>(ptr);
71 template<typename T> struct is_trivial_iterator< normal_iterator<T> > : public true_type {};