|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-09-03 13:42:56
In <boost/operators.hpp>, we have templates like:
//==========================================================================
template <class T,
class V,
class D = std::ptrdiff_t,
class P = V*,
class R = V&>
struct bidirectional_iterator_helper
: equality_comparable1<T
, unit_steppable<T
, dereferenceable<T, P
, boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
> > > > {};
//==========================================================================
where the operator helpers are attached to the iterator base. Maybe we can
do a separation like:
//==========================================================================
template <class T, class P, class B = ::boost::detail::empty_base>
struct bidirectional_iterator_operators
: equality_comparable1<T
, unit_steppable<T
, dereferenceable<T, P, B
> > > {};
//...
template <class T,
class V,
class D = std::ptrdiff_t,
class P = V*,
class R = V&>
struct bidirectional_iterator_helper
: bidirectional_iterator_operators <T, P
, boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
> > {};
//==========================================================================
in case we need to supply the iterator base in a different manner (like now
when I'm trying to use these operators with an iterator based off a reverse
iterator of another iterator class I defined).
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk