Boost logo

Boost :

From: Ronald Garcia (garcia_at_[hidden])
Date: 2002-10-22 12:54:39

Hi Dave,

On Fri, 18 Oct 2002, Dave Gomboc wrote:

> I am in the process of substituting boost::multi_array in for a homebrew
> solution. One of my test cases unexpectedly failed with an assertion
> error at line 369 of multi_array_ref.hpp, because there are no elements in
> the array.


> Does the multi_array code actually require that there not be zero elements
> for the code to work properly, or is the assert is simply there because
> "you probably don't want to be doing this"? In my case, I _do_ want to be
> doing this -- I don't want to have special-case code when no storage is
> actually needed, I'd rather have begin() == end() for the appropriate
> dimensions so that loops involving such degenerate cases do no
> computation.

I must admit I hadn't considered this situation arising. It seems
reasonable to not want to special-case code that may create an array of
greater than zero dimensions but zero elements. Some
portion of the code may currently assume that the multi_array holds
greater than zero elements. I will investigate this. Thanks
for the comment.



Boost list run by bdawes at, gregod at, cpdaniel at, john at