Boost logo

Boost Users :

From: Raoul Gough (yg-boost-users_at_[hidden])
Date: 2003-08-12 18:47:38


I have a situation where I want to specialize a class template on the
basis of iterator_category, but I don't see how to get one of the
standard categories when passed a boost iterator adapter. Currently,
std::iterator_traits<MyIter>::iterator_category is giving me:

boost::iterator_tag<boost::writable_lvalue_iterator_tag
                   , boost::random_access_traversal_tag>

I need random_access_iterator_tag for the right specialization to
happen. Is there any way to get the *standard* iterator category from
a boost iterator?

MyIter is boost::indirect_iterator<std::vector<int *>::iterator>
compiler is gcc 3.2.3 (mingw special 20030504-1)

BTW, isn't this non-standard iterator_category bound to cause
problems? e.g. if I use std::distance (MyIter(), MyIter()), how does
the compiler know that it should use the
std::random_access_iterator_tag specialization of std::distance?

-- 
Raoul Gough
"Let there be one measure for wine throughout our kingdom, and one
measure for ale, and one measure for corn" - Magna Carta

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net