Boost logo

Boost :

From: DY, JERRY U \(SBCSI\) (jd2419_at_[hidden])
Date: 2004-07-21 18:08:07

I'm troubleshooting counting_iterator_test.hpp. In particular:

FILE: counting_iterator_test.cpp
class my_int2 {
        typedef std::bidirectional_iterator_tag iterator_category;

FILE: counting_iterator.hpp

template <class Incrementable, class CategoryOrTraversal, class
struct counting_iterator_base {
      typedef typename detail::ia_dflt_help<
        , mpl::apply_if<
            , mpl::identity<random_access_traversal_tag>
            , iterator_traversal<Incrementable>
>::type traversal;


The class my_int2 is passed as parameter "Incrementable" to
counting_iterator_base, but is failing the is_numeric test so my_int2 is
just a bidirectional iterator (see mpl::apply_if above). If it passes
the is_numeric test, then it's a random access traversal tag. The way it
passes the is_numeric test is to specialize std::numeric_limits like so:

template <> class std::numeric_limits<my_int2> {
        static bool const is_specialized = false;

But I don't find that in the source. It appears that aC++ doing the
right thing, but I know I'm wrong. Could somebody please help?? Thanks!


Boost list run by bdawes at, gregod at, cpdaniel at, john at