Subject: [Boost-bugs] [Boost C++ Libraries] #6554: Compiler error dereferencing multi_array value via an iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-13 17:46:48
#6554: Compiler error dereferencing multi_array value via an iterator
------------------------------+---------------------------------------------
Reporter: bill_buklis | Owner: garcia
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multi_array
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
It is currently impossible to dereference/access the values contained in a
multi_array via the -> operator from an iterator to the multi_array
element. However, use the * operator works.
Example:
{{{
struct data
{
int value;
};
typedef boost::multi_array<data, 2> array_type;
array_type a(boost::extents[4][5]);
// ERROR: Cannot compile this line
a.begin()->begin()->value = 7;
// Compiles successfully
(*a.begin()->begin()).value = 5;
}}}
I'm using Visual Studio 2010. This is an error in both debug and release
modes. This is the error:
boost/multi_array/iterator.hpp(40): error C2528: '->' : pointer to
reference is illegal
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6554> 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:09 UTC