// Boost.Range library // // Copyright Thorsten Ottosen 2003-2004. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see http://www.boost.org/libs/range/ // #ifndef BOOST_RANGE_DETAIL_END_HPP #define BOOST_RANGE_DETAIL_END_HPP #include // BOOST_MSVC #include #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) # include #else # include # include # include # if BOOST_WORKAROUND(BOOST_MSVC, < 1310) # include # endif namespace boost { namespace range_detail { template< typename T > struct range_end; ////////////////////////////////////////////////////////////////////// // default ////////////////////////////////////////////////////////////////////// template<> struct range_end { template< typename C > static BOOST_RANGE_DEDUCED_TYPENAME range_iterator::type fun( C& c ) { return c.end(); }; }; ////////////////////////////////////////////////////////////////////// // pair ////////////////////////////////////////////////////////////////////// template<> struct range_end { template< typename P > static BOOST_RANGE_DEDUCED_TYPENAME range_iterator

::type fun( const P& p ) { return p.second; } }; ////////////////////////////////////////////////////////////////////// // array ////////////////////////////////////////////////////////////////////// template<> struct range_end { #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310) template< typename T, std::size_t sz > static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] ) { return boost::range_detail::array_end( boost_range_array ); } #else template static BOOST_RANGE_DEDUCED_TYPENAME remove_extent::type* fun(T& t) { return t + remove_extent::size; } #endif }; } // namespace 'range_detail' template< typename C > inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator::type end( C& c ) { return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); } } // namespace 'boost' # endif // VC6 #endif