Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-06-05 19:08:06


AMDG

Eric Darve wrote:
> Hi,
>
> I found what I think is a bug in boost/multi_array.hpp. Perhaps some
> of you can explain what is wrong. Look at the code below. When
> executed you get the following error:
> multi_array_ref.hpp:487: failed assertion
> `std::equal(other.shape(),other.shape()+this->num_dimensions(),
> this->shape())'
>
> This is caused by the line
> x.resize(extents[n+1][3]);
>

This seems to be by design. Multiarray doesn't have normal assignment
semantics.

#include "boost/multi_array.hpp"
#include <vector>

using boost::multi_array;
using boost::extents;
using std::vector;

int main(void) {

    multi_array<int, 1> x(boost::extents[2]), y;
    y = x;
}

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net