ticket 8028 - combine reimplemented and now documented.

This commit is contained in:
Neil Groves
2014-03-08 20:52:10 +00:00
parent 94c31a790b
commit 3ed0626756
12 changed files with 550 additions and 344 deletions

View File

@ -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