|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-14 05:31:46
Sheesh. No offense, but that sounds more complicated than it's worth.
If someone needs extended categorization they can define an
extended_iterator_tag, no?
-Dave
----- Original Message -----
From: <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, June 14, 2000 1:52 AM
Subject: [boost] Re: reverse_iterator.hpp uploaded
> jsiek_at_[hidden] writes:
> > The custom tag issue will be more difficult... as of right now I don't
> > see a way to handle that. The problem is that class template
> > specialization requires exact matches. Therefore if you have a
> > sub-class of std::random_access_iterator_tag, you'll get the default
> > unspecialized iterator_adaptor instead of the specialization for
> > std::random_access_iterator_tag :( I'll need to put my thinking cap
> > on...
>
> I've got a possible solution for this... has a slight catch though.
> It requires custom iterator tags to specialize an inheritance_traits
> class. This allows me to traverse up the inheritance tree looking for
> a match.
>
> struct my_iterator_tag : public std::random_access_iterator_tag { };
>
> namespace boost {
> template<> struct inheritance_traits<my_iterator_tag> {
> static const bool has_base_class = true;
> typedef std::random_access_iterator_tag base_class_type;
> };
> }
>
>
> Ciao,
>
> Jeremy
>
> ------------------------------------------------------------------------
> IT Professionals: Match your unique skills with the best IT projects at
> http://click.egroups.com/1/3381/3/_/9351/_/960961932/
> ------------------------------------------------------------------------
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk