Boost logo

Boost :

From: Andreas Huber (ah2003_at_[hidden])
Date: 2003-02-28 19:32:37


Hi Aleksey

For warning levels >= 2 the attached program produces the given warning.
AFAICT, the code in advance.hpp should be correct, so this has low priority.
However, to avoid the warning, the if_ expression should probably be
replaced with its apply_if equivalent.

Thanks,

Andreas

---------------------------------------------------------------------------
#include <boost/mpl/list.hpp>
#include <boost/mpl/distance.hpp>
#include <boost/mpl/advance.hpp>

namespace mpl = boost::mpl;

typedef mpl::list< int > my_list;
typedef mpl::distance<
  mpl::begin< my_list >::type,
  mpl::end< my_list >::type >::type my_distance;
typedef mpl::advance< mpl::begin< my_list >::type, my_distance >::type
my_iter;

int main()
{
  return 0;
}

---------------------------------------------------------------------------
D:\Data\Private\boostCvsRoot\boost\boost\mpl\negate.hpp(36) : warning C4146:
unary minus operator applied to unsigned type, result still unsigned
        D:\Data\Private\boostCvsRoot\boost\boost\mpl\advance.hpp(51) : see
reference to class template instantiation 'boost::mpl::negate<T>' being
compiled
        with
        [
            T=my_distance
        ]
        D:\Data\Private\boostCvsRoot\boost\boost\mpl\advance.hpp(78) : see
reference to class template instantiation
'boost::mpl::aux::advance_impl<Category,Iterator,N>' being compiled
        with
        [

Category=boost::mpl::list_iterator<boost::mpl::list<int>::type>::category,
            Iterator=boost::mpl::begin<my_list>::type,
            N=my_distance
        ]
        TestPartial.cpp(11) : see reference to class template instantiation
'boost::mpl::advance<Iterator,N>' being compiled
        with
        [
            Iterator=boost::mpl::begin<my_list>::type,
            N=my_distance
        ]

---------------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk