mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 22:34:31 +02:00
distance/advance fixes
[SVN r17795]
This commit is contained in:
@@ -46,10 +46,13 @@ namespace aux {
|
||||
template< typename Category, typename Iterator, typename N >
|
||||
struct advance_impl
|
||||
{
|
||||
typedef typename less< N,integral_c<long,0> >::type backward_;
|
||||
typedef typename if_< backward_, negate<N>, N >::type offset_;
|
||||
|
||||
typedef typename if_<
|
||||
typename less< N,integral_c<long,0> >::type
|
||||
, aux::advance_backward< ::boost::mpl::negate<N>::value >
|
||||
, aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(N)::value >
|
||||
backward_
|
||||
, aux::advance_backward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
|
||||
, aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
|
||||
>::type algo_;
|
||||
|
||||
typedef typename BOOST_MPL_AUX_APPLY1(algo_,Iterator)::type type;
|
||||
|
@@ -45,7 +45,7 @@ struct is_msvc_eti_arg
|
||||
{
|
||||
static no_tag test(...);
|
||||
static yes_tag test(eti_int_convertible);
|
||||
static T get();
|
||||
static T& get();
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
sizeof(test(get())) == sizeof(yes_tag)
|
||||
|
@@ -42,7 +42,7 @@ template< typename Category, typename First, typename Last >
|
||||
struct distance_impl
|
||||
: iter_fold<
|
||||
iterator_range<First,Last>
|
||||
, integral_c<unsigned long, 0>
|
||||
, integral_c<long, 0>
|
||||
, next<>
|
||||
>
|
||||
{
|
||||
@@ -81,7 +81,7 @@ struct distance_impl
|
||||
template< typename First, typename Last > struct result_
|
||||
: iter_fold<
|
||||
iterator_range<First,Last>
|
||||
, integral_c<unsigned long, 0>
|
||||
, integral_c<long, 0>
|
||||
, next<>
|
||||
>
|
||||
{
|
||||
|
Reference in New Issue
Block a user