|
Boost Users : |
Subject: Re: [Boost-users] [multi_array] Why the precondition on assignment?
From: Peter Barker (newbarker_at_[hidden])
Date: 2009-02-26 05:40:51
I've never tried to write a multi array class so perhaps I'm looking
at the problem too simplistically.
With std::vector (and probably all containers?) operator= will
potentially reallocate, so I don't understand why boost::multi_array
should be special. It's not really a *surprise* reallocation is it?
operator= implies to me that you want to forget what's currently being
held and assume a copy of the data that the other object has. I'd be
*expecting* reallocations and existing indices/iterators to be
invalidated.
I've only just started using multi_array and I know there's a lot more
to it than I'm aware of so apologies if my view on operator= is based
more on ignorance than enlightenment!
Regards,
Pete
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