forked from boostorg/range
[boost][range] - Trac 5971 - size() should return an unsigned type.
[SVN r77990]
This commit is contained in:
41
include/boost/range/detail/size_type.hpp
Executable file → Normal file
41
include/boost/range/detail/size_type.hpp
Executable file → Normal file
@@ -17,12 +17,19 @@
|
||||
// missing partial specialization workaround.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace boost
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template< typename T >
|
||||
struct range_size_type_;
|
||||
struct range_size_type_
|
||||
{
|
||||
template< typename C >
|
||||
struct pts
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size_type_<std_container_>
|
||||
@@ -33,36 +40,14 @@ namespace boost
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
template<>
|
||||
struct range_size_type_<std_pair_>
|
||||
{
|
||||
template< typename P >
|
||||
struct pts
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size_type_<array_>
|
||||
{
|
||||
template< typename A >
|
||||
struct pts
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class range_size
|
||||
{
|
||||
typedef typename range_detail::range<C>::type c_type;
|
||||
public:
|
||||
typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
|
||||
typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user