Boost logo

Boost :

Subject: Re: [boost] [iterators] Missing typedefs in v1.57
From: news.gmane.org (boost57_at_[hidden])
Date: 2014-12-09 15:08:33


Class iterator_facade has been refactored in v1.57 such that most of its
functionality is now in iterator_facade_base. This includes the typedefs
for difference_type and reference. Hence, my classes which are derived from
iterator_facade now have to declare them. For example:

template <typename Stream, typename Value>
class char_iter
    : public boost::iterators::iterator_facade< char_iter<Stream, Value>,
Value,
                                                boost::iterators::random_access_traversal_tag,
                                                Value, Size >
{
public:
    typedef typename iterator_facade_::difference_type difference_type;
    typedef typename iterator_facade_::reference reference;
    ...
};

Have I misunderstood how to do this?

"Andrey Semashev" wrote in message news:1528031.YEdZPUoJ70_at_lastique-pc...

On Tuesday 09 December 2014 10:43:11 news.gmane.org wrote:
> I posted this a week ago in the user mailing list but it went unnoticed.
> Perhaps this developers' list is a better place to post it.
>
> The typedefs for difference_type and reference used to be in scope for
> classes derived from iterator_facade. Since v1.57 they have to be
> declared
> thus:
>
> typedef typename iterator_facade_::difference_type difference_type;
> typedef typename iterator_facade_::reference reference;
>
> This seems out of place for a class that was designed to reduce boiler
> plate
> code. However, if the change was intentional, please document it.

I'm not sure what you mean. The typedefs are in the base class of
iterator_facade and are public. As such they are accessible to the derived
classes. Can you elaborate what the problem is?

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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