|
Boost Users : |
Subject: Re: [Boost-users] [multi_array] operator= requires resize - why?
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2012-06-04 08:43:24
> Ronald Garcia wrote
>> If multi_array's assignment
>> had different semantics from the rest of the arrays, then assignment
>> would behave very differently generic algorithms depending on whether
>> you pass a multi_array or a different function.
>
> I cannot get why introducing automatically resizing would cause any trouble
> for any generic algorithm, since it would not prevent from calling the
> assignment for objects that do have the same shape. Do you have any precise
> example to explain why it would be such a trouble?
A total guess... You have two 4D multi_arrays used in an algorithm.
Algorithm checks that their fastest dimension has the same size. It
does. The algorithm is called recursively on a 3D subproblem. The
algorithm checks that the two 3D sub-multi_arrays have a fastest
dimension with the same size. They don't. Now what should the
generic algorithm do? If it resizes the 3D subproblem bad things
happen to the original 4D multi_array.
- Rhys
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