3 // Copyright Thorsten Ottosen 2003-2004. Use, modification and
4 // distribution is subject to the Boost Software License, Version
5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // For more information, see http://www.boost.org/libs/range/
11 #ifndef BOOST_RANGE_END_HPP
12 #define BOOST_RANGE_END_HPP
18 #include <boost/range/config.hpp>
20 #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
21 #include <boost/range/detail/end.hpp>
24 #include <boost/range/detail/implementation_help.hpp>
25 #include <boost/range/iterator.hpp>
26 #include <boost/range/const_iterator.hpp>
27 #include <boost/config.hpp>
28 #include <boost/config/workaround.hpp>
33 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
34 namespace range_detail
38 //////////////////////////////////////////////////////////////////////
40 //////////////////////////////////////////////////////////////////////
41 template< typename C >
42 BOOST_CONSTEXPR inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
46 // If you get a compile-error here, it is most likely because
47 // you have not implemented range_begin() properly in
53 //////////////////////////////////////////////////////////////////////
55 //////////////////////////////////////////////////////////////////////
57 template< typename Iterator >
58 BOOST_CONSTEXPR inline Iterator range_end( const std::pair<Iterator,Iterator>& p )
63 template< typename Iterator >
64 BOOST_CONSTEXPR inline Iterator range_end( std::pair<Iterator,Iterator>& p )
69 //////////////////////////////////////////////////////////////////////
71 //////////////////////////////////////////////////////////////////////
73 template< typename T, std::size_t sz >
74 BOOST_CONSTEXPR inline const T* range_end( const T (&a)[sz] ) BOOST_NOEXCEPT
76 return range_detail::array_end<T,sz>( a );
79 template< typename T, std::size_t sz >
80 BOOST_CONSTEXPR inline T* range_end( T (&a)[sz] ) BOOST_NOEXCEPT
82 return range_detail::array_end<T,sz>( a );
85 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
86 } // namespace 'range_detail'
89 namespace range_adl_barrier
93 #if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
96 inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
98 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
99 using namespace range_detail;
101 return range_end( r );
105 #if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
108 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
110 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
111 using namespace range_detail;
113 return range_end( r );
116 } // namespace range_adl_barrier
117 } // namespace 'boost'
119 #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
123 namespace range_adl_barrier
126 BOOST_CONSTEXPR inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
127 const_end( const T& r )
129 return boost::range_adl_barrier::end( r );
131 } // namespace range_adl_barrier
132 using namespace range_adl_barrier;