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 #include <boost/range/detail/implementation_help.hpp>
21 #include <boost/range/iterator.hpp>
22 #include <boost/range/const_iterator.hpp>
23 #include <boost/config.hpp>
24 #include <boost/config/workaround.hpp>
29 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
30 namespace range_detail
34 //////////////////////////////////////////////////////////////////////
36 //////////////////////////////////////////////////////////////////////
37 template< typename C >
38 BOOST_CONSTEXPR inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
42 // If you get a compile-error here, it is most likely because
43 // you have not implemented range_begin() properly in
49 //////////////////////////////////////////////////////////////////////
51 //////////////////////////////////////////////////////////////////////
53 template< typename Iterator >
54 BOOST_CONSTEXPR inline Iterator range_end( const std::pair<Iterator,Iterator>& p )
59 template< typename Iterator >
60 BOOST_CONSTEXPR inline Iterator range_end( std::pair<Iterator,Iterator>& p )
65 //////////////////////////////////////////////////////////////////////
67 //////////////////////////////////////////////////////////////////////
69 template< typename T, std::size_t sz >
70 BOOST_CONSTEXPR inline const T* range_end( const T (&a)[sz] ) BOOST_NOEXCEPT
72 return range_detail::array_end<T,sz>( a );
75 template< typename T, std::size_t sz >
76 BOOST_CONSTEXPR inline T* range_end( T (&a)[sz] ) BOOST_NOEXCEPT
78 return range_detail::array_end<T,sz>( a );
81 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
82 } // namespace 'range_detail'
85 namespace range_adl_barrier
89 #if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
92 inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
94 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
95 using namespace range_detail;
97 return range_end( r );
101 #if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
104 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
106 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
107 using namespace range_detail;
109 return range_end( r );
112 } // namespace range_adl_barrier
113 } // namespace 'boost'
117 namespace range_adl_barrier
120 BOOST_CONSTEXPR inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
121 const_end( const T& r )
123 return boost::range_adl_barrier::end( r );
125 } // namespace range_adl_barrier
126 using namespace range_adl_barrier;