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.
19 #include <thrust/detail/config.h>
20 #include <thrust/iterator/counting_iterator.h>
21 #include <thrust/iterator/iterator_adaptor.h>
22 #include <thrust/iterator/detail/any_assign.h>
23 #include <cstddef> // for std::ptrdiff_t
28 // forward declaration of discard_iterator
29 template<typename> class discard_iterator;
35 template<typename System>
36 struct discard_iterator_base
38 // XXX value_type should actually be void
39 // but this interferes with zip_iterator<discard_iterator>
40 typedef any_assign value_type;
41 typedef any_assign& reference;
42 typedef std::ptrdiff_t incrementable;
44 typedef typename thrust::counting_iterator<
47 thrust::random_access_traversal_tag
50 typedef typename thrust::iterator_adaptor<
51 discard_iterator<System>,
54 typename thrust::iterator_system<base_iterator>::type,
55 typename thrust::iterator_traversal<base_iterator>::type,
58 }; // end discard_iterator_base