github.com/searKing/golang/go@v1.2.74/os/signal/cgo/include/boost/detail/iterator.hpp (about) 1 // (C) Copyright David Abrahams 2002. 2 // Distributed under the Boost Software License, Version 1.0. (See 3 // accompanying file LICENSE_1_0.txt or copy at 4 // http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef ITERATOR_DWA122600_HPP_ 7 #define ITERATOR_DWA122600_HPP_ 8 9 // This header is obsolete and will be deprecated. 10 11 #include <iterator> 12 #if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) 13 #include <cstddef> 14 #endif 15 16 namespace boost 17 { 18 19 namespace detail 20 { 21 22 using std::iterator_traits; 23 using std::distance; 24 25 #if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) 26 // std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters 27 // when one of the arguments is an array and the other one is a pointer. 28 template< typename T, std::size_t N > 29 inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right) 30 { 31 return std::distance(static_cast< T* >(left), right); 32 } 33 #endif 34 35 } // namespace detail 36 37 } // namespace boost 38 39 #endif // ITERATOR_DWA122600_HPP_