/* * 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. */ #pragma once #include #include #if __GNUC__ // forward declaration of gnu's __normal_iterator namespace __gnu_cxx { template class __normal_iterator; } // end __gnu_cxx #endif // __GNUC__ #if _MSC_VER // forward declaration of MSVC's "normal iterators" namespace std { template struct _Ranit; } // end std #endif // _MSC_VER namespace thrust { namespace detail { #ifdef __GNUC__ template struct is_gnu_normal_iterator : false_type {}; // catch gnu __normal_iterators template struct is_gnu_normal_iterator< __gnu_cxx::__normal_iterator > : true_type {}; #endif // __GNUC__ #ifdef _MSC_VER // catch msvc _Ranit template struct is_convertible_to_msvc_Ranit : is_convertible< Iterator, std::_Ranit< typename iterator_value::type, typename iterator_difference::type, typename iterator_pointer::type, typename iterator_reference::type > > {}; #endif // _MSC_VER template struct is_trivial_iterator : integral_constant< bool, is_pointer::value | thrust::detail::is_thrust_pointer::value #if __GNUC__ | is_gnu_normal_iterator::value #endif // __GNUC__ #ifdef _MSC_VER | is_convertible_to_msvc_Ranit::value #endif // _MSC_VER > {}; } // end detail } // end thrust