forked from boostorg/range
ticket 8028 - combine reimplemented and now documented.
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include <boost/range/detail/extract_optional_type.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
|
||||
@ -29,33 +30,45 @@ namespace boost
|
||||
// default
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace range_detail {
|
||||
BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator )
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
struct range_const_iterator : range_detail::extract_const_iterator<C>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// pair
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct range_const_iterator< std::pair<Iterator,Iterator> >
|
||||
namespace range_detail
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// array
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct range_const_iterator< T[sz] >
|
||||
{
|
||||
typedef const T* type;
|
||||
};
|
||||
BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator )
|
||||
|
||||
template< typename C >
|
||||
struct range_const_iterator
|
||||
: extract_const_iterator<C>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// pair
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct range_const_iterator<std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// array
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct range_const_iterator< T[sz] >
|
||||
{
|
||||
typedef const T* type;
|
||||
};
|
||||
|
||||
} // namespace range_detail
|
||||
|
||||
template<typename C>
|
||||
struct range_const_iterator
|
||||
: range_detail::range_const_iterator<
|
||||
typename remove_reference<C>::type
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
Reference in New Issue
Block a user