distance/advance fixes

[SVN r17795]
This commit is contained in:
Aleksey Gurtovoy
2003-03-10 02:27:06 +00:00
parent b43fe08bf2
commit 4c750b8152
3 changed files with 9 additions and 6 deletions

View File

@@ -46,10 +46,13 @@ namespace aux {
template< typename Category, typename Iterator, typename N > template< typename Category, typename Iterator, typename N >
struct advance_impl 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_< typedef typename if_<
typename less< N,integral_c<long,0> >::type backward_
, aux::advance_backward< ::boost::mpl::negate<N>::value > , aux::advance_backward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
, aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(N)::value > , aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
>::type algo_; >::type algo_;
typedef typename BOOST_MPL_AUX_APPLY1(algo_,Iterator)::type type; typedef typename BOOST_MPL_AUX_APPLY1(algo_,Iterator)::type type;

View File

@@ -45,7 +45,7 @@ struct is_msvc_eti_arg
{ {
static no_tag test(...); static no_tag test(...);
static yes_tag test(eti_int_convertible); static yes_tag test(eti_int_convertible);
static T get(); static T& get();
BOOST_STATIC_CONSTANT(bool, value = BOOST_STATIC_CONSTANT(bool, value =
sizeof(test(get())) == sizeof(yes_tag) sizeof(test(get())) == sizeof(yes_tag)

View File

@@ -42,7 +42,7 @@ template< typename Category, typename First, typename Last >
struct distance_impl struct distance_impl
: iter_fold< : iter_fold<
iterator_range<First,Last> iterator_range<First,Last>
, integral_c<unsigned long, 0> , integral_c<long, 0>
, next<> , next<>
> >
{ {
@@ -81,7 +81,7 @@ struct distance_impl
template< typename First, typename Last > struct result_ template< typename First, typename Last > struct result_
: iter_fold< : iter_fold<
iterator_range<First,Last> iterator_range<First,Last>
, integral_c<unsigned long, 0> , integral_c<long, 0>
, next<> , next<>
> >
{ {