Boost logo

Boost Users :

From: Ronald Garcia (garcia_at_[hidden])
Date: 2007-01-16 10:59:23


Hello Markus,

On Jan 16, 2007, at 9:06 AM, Markus Werle wrote:

> IMHO the behaviour of operator= for multi_array is a little bit
> broken.
> A lot of preconditions required:

Indeed operator= for multi_array requires the sizes of the
multi_arrays to match, hence the assertions. The multi_array type is
not meant to automatically resize when assigned to. All resizing is
intentionally meant to be explicit.
For your application, you will need to resize your array prior to
assignment.

>
> Besides the fact that I get mad about asserts instead of exceptions
> (please change this to a way users may choose) why do we have such
> an odd
> behaviour here?
>

I'm afraid that we do not agree about the place for asserts versus
exceptions. The assertions in operator=() enforce library
preconditions regarding assignment. See the document http://
boost.org/more/error_handling.html under "What about programmer errors?"

Regards,
ron


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