Subject: [Boost-bugs] [Boost C++ Libraries] #11847: reference typedef no longer available in parent class of iterator_facade
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-15 17:52:04
#11847: reference typedef no longer available in parent class of iterator_facade
------------------------------+------------------------------
Reporter: alexhighviz@⦠| Owner: jeffrey.hellrung
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
------------------------------+------------------------------
The iterator_facade defines the reference type. In Boost version 1.56 the
parent class to the facade could make use of this type, from version 1.57
this is no longer possible.
This is not difficult to work around, but does cause existing code to
fail.
I am using Visual Studio 2013 (12.0)
See code below:
#include <boost/iterator/iterator_facade.hpp>
#include <vector>
template<class T>
class simple_iterator : public
boost::iterator_facade<simple_iterator<T>, T,
boost::forward_traversal_tag>
{
public:
simple_iterator(const typename std::vector<T>::iterator& i) : m_iter(i)
{}
private:
friend boost::iterator_core_access;
/* The commented line compiled in 1.56 but no longer so in 1.57 */
/* reference dereference() const { return *m_iter; } */
T& dereference() const { return *m_iter; }
bool equal(const simple_iterator& that) { return m_iter == that.m_iter;
}
void increment() { ++m_iter; }
typename std::vector<T>::iterator m_iter;
};
int main()
{
std::vector<int> v = { 1, 2, 3 } ;
simple_iterator<int> i(v.begin());
simple_iterator<int>::reference vi = *i;
return 0;
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11847> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC