24
24
#include <thrust/iterator/iterator_traits.h>
25
25
#include <thrust/system/detail/generic/select_system.h>
26
26
#include <thrust/system/detail/generic/remove.h>
27
#include <thrust/detail/adl_helper.h>
27
#include <thrust/system/detail/adl/remove.h>
33
template<typename DerivedPolicy,
34
typename ForwardIterator,
36
ForwardIterator remove(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
37
ForwardIterator first,
41
using thrust::system::detail::generic::remove;
42
return remove(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, value);
46
template<typename DerivedPolicy,
47
typename InputIterator,
48
typename OutputIterator,
50
OutputIterator remove_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
53
OutputIterator result,
56
using thrust::system::detail::generic::remove_copy;
57
return remove_copy(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, result, value);
58
} // end remove_copy()
61
template<typename DerivedPolicy,
62
typename ForwardIterator,
64
ForwardIterator remove_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
65
ForwardIterator first,
69
using thrust::system::detail::generic::remove_if;
70
return remove_if(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, pred);
74
template<typename DerivedPolicy,
75
typename InputIterator,
76
typename OutputIterator,
78
OutputIterator remove_copy_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
81
OutputIterator result,
84
using thrust::system::detail::generic::remove_copy_if;
85
return remove_copy_if(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, result, pred);
86
} // end remove_copy_if()
89
template<typename DerivedPolicy,
90
typename ForwardIterator,
91
typename InputIterator,
93
ForwardIterator remove_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
94
ForwardIterator first,
96
InputIterator stencil,
99
using thrust::system::detail::generic::remove_if;
100
return remove_if(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, stencil, pred);
104
template<typename DerivedPolicy,
105
typename InputIterator1,
106
typename InputIterator2,
107
typename OutputIterator,
109
OutputIterator remove_copy_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
110
InputIterator1 first,
112
InputIterator2 stencil,
113
OutputIterator result,
116
using thrust::system::detail::generic::remove_copy_if;
117
return remove_copy_if(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, stencil, result, pred);
118
} // end remove_copy_if()
32
121
template<typename ForwardIterator,
34
123
ForwardIterator remove(ForwardIterator first,
38
127
using thrust::system::detail::generic::select_system;
39
using thrust::system::detail::generic::remove;
41
typedef typename thrust::iterator_system<ForwardIterator>::type system;
43
return remove(select_system(system()), first, last, value);
129
typedef typename thrust::iterator_system<ForwardIterator>::type System;
133
return thrust::remove(select_system(system), first, last, value);
46
137
template<typename InputIterator,
47
138
typename OutputIterator,
54
145
using thrust::system::detail::generic::select_system;
55
using thrust::system::detail::generic::remove_copy;
57
typedef typename thrust::iterator_system<InputIterator>::type system1;
58
typedef typename thrust::iterator_system<OutputIterator>::type system2;
60
return remove_copy(select_system(system1(),system2()), first, last, result, value);
147
typedef typename thrust::iterator_system<InputIterator>::type System1;
148
typedef typename thrust::iterator_system<OutputIterator>::type System2;
153
return thrust::remove_copy(select_system(system1,system2), first, last, result, value);
61
154
} // end remove_copy()
63
157
template<typename ForwardIterator,
64
158
typename Predicate>
65
159
ForwardIterator remove_if(ForwardIterator first,
69
163
using thrust::system::detail::generic::select_system;
70
using thrust::system::detail::generic::remove_if;
72
typedef typename thrust::iterator_system<ForwardIterator>::type system;
74
return remove_if(select_system(system()), first, last, pred);
165
typedef typename thrust::iterator_system<ForwardIterator>::type System;
169
return thrust::remove_if(select_system(system), first, last, pred);
75
170
} // end remove_if()
77
173
template<typename ForwardIterator,
78
174
typename InputIterator,
79
175
typename Predicate>
85
181
using thrust::system::detail::generic::select_system;
86
using thrust::system::detail::generic::remove_if;
88
typedef typename thrust::iterator_system<ForwardIterator>::type system1;
89
typedef typename thrust::iterator_system<InputIterator>::type system2;
91
return remove_if(select_system(system1(),system2()), first, last, stencil, pred);
183
typedef typename thrust::iterator_system<ForwardIterator>::type System1;
184
typedef typename thrust::iterator_system<InputIterator>::type System2;
189
return thrust::remove_if(select_system(system1,system2), first, last, stencil, pred);
92
190
} // end remove_if()
94
193
template<typename InputIterator,
95
194
typename OutputIterator,
96
195
typename Predicate>
102
201
using thrust::system::detail::generic::select_system;
103
using thrust::system::detail::generic::remove_copy_if;
105
typedef typename thrust::iterator_system<InputIterator>::type system1;
106
typedef typename thrust::iterator_system<OutputIterator>::type system2;
108
return remove_copy_if(select_system(system1(),system2()), first, last, result, pred);
203
typedef typename thrust::iterator_system<InputIterator>::type System1;
204
typedef typename thrust::iterator_system<OutputIterator>::type System2;
209
return thrust::remove_copy_if(select_system(system1,system2), first, last, result, pred);
109
210
} // end remove_copy_if()
111
213
template<typename InputIterator1,
112
214
typename InputIterator2,
113
215
typename OutputIterator,
121
223
using thrust::system::detail::generic::select_system;
122
using thrust::system::detail::generic::remove_copy_if;
124
typedef typename thrust::iterator_system<InputIterator1>::type system1;
125
typedef typename thrust::iterator_system<InputIterator2>::type system2;
126
typedef typename thrust::iterator_system<OutputIterator>::type system3;
128
return remove_copy_if(select_system(system1(),system2(),system3()), first, last, stencil, result, pred);
225
typedef typename thrust::iterator_system<InputIterator1>::type System1;
226
typedef typename thrust::iterator_system<InputIterator2>::type System2;
227
typedef typename thrust::iterator_system<OutputIterator>::type System3;
233
return thrust::remove_copy_if(select_system(system1,system2,system3), first, last, stencil, result, pred);
129
234
} // end remove_copy_if()
131
237
} // end namespace thrust