Subject: [Boost-bugs] [Boost C++ Libraries] #8339: Iterator facade does not work for const iterator with array value type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-27 02:39:58
#8339: Iterator facade does not work for const iterator with array value type
-------------------------------------+--------------------------------------
Reporter: nathanridge | Owner: jeffrey.hellrung
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
The following code fails to compile:
{{{
#include <boost/iterator/iterator_facade.hpp>
struct iterator : boost::iterator_facade<iterator,
char [4],
boost::random_access_traversal_tag,
char const (&)[4]>
{
};
}}}
(I omitted the body of the derived class, but that's irrelevant, it's not
what's causing the error).
The error is:
{{{
In file included from test.cpp:1:
In file included from boost/iterator/iterator_facade.hpp:17:
boost/iterator/detail/operator_brackets_dispatch.hpp:33:12: error:
function cannot return array type 'result_type' (aka 'char [4]')
static result_type apply(Iterator const & i)
^
boost/iterator/iterator_facade.hpp:583:16: note: in instantiation of
template class 'boost::detail::operator_brackets_value<char [4]>'
requested here
typename operator_brackets_dispatch_::result_type
^
test.cpp:3:19: note: in instantiation of template class
'boost::iterator_facade<iterator, char [4],
boost::random_access_traversal_tag, char const (&)[4], long>' requested
here
struct iterator : boost::iterator_facade<iterator,
^
In file included from test.cpp:1:
boost/iterator/iterator_facade.hpp:583:7: error: function cannot return
array type 'typename operator_brackets_dispatch_::result_type' (aka 'char
[4]')
typename operator_brackets_dispatch_::result_type
^
test.cpp:3:19: note: in instantiation of template class
'boost::iterator_facade<iterator, char [4],
boost::random_access_traversal_tag, char const (&)[4], long>' requested
here
struct iterator : boost::iterator_facade<iterator,
^
}}}
It would be great if this use case could be supported.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8339> 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:12 UTC