/* * Copyright 2008-2012 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*! \file iterator_traits.inl * \brief Inline file for iterator_traits.h. */ #include #include #include namespace thrust { template struct iterator_value { typedef typename thrust::iterator_traits::value_type type; }; // end iterator_value template struct iterator_pointer { typedef typename thrust::iterator_traits::pointer type; }; // end iterator_pointer template struct iterator_reference { typedef typename iterator_traits::reference type; }; // end iterator_reference template struct iterator_difference { typedef typename thrust::iterator_traits::difference_type type; }; // end iterator_difference template struct iterator_system : detail::iterator_category_to_system< typename thrust::iterator_traits::iterator_category > { }; // end iterator_system // specialize iterator_system for void *, which has no category template<> struct iterator_system { typedef thrust::iterator_system::type type; }; // end iterator_system template<> struct iterator_system { typedef thrust::iterator_system::type type; }; // end iterator_system template struct iterator_traversal : detail::iterator_category_to_traversal< typename thrust::iterator_traits::iterator_category > { }; // end iterator_traversal namespace detail { template struct is_iterator_traversal : thrust::detail::is_convertible { }; // end is_iterator_traversal template struct is_iterator_system : detail::or_< detail::is_convertible, detail::or_< detail::is_convertible, detail::is_convertible > > { }; // end is_iterator_system } // end namespace detail } // end namespace thrust