[[patch] valarray (was Re: valarray_copy implementation question)

Christopher Jefferson chris@bubblescope.net
Thu Nov 26 16:52:00 GMT 2009


On 26 Nov 2009, at 15:29, Christian BRUEL wrote:

> I think I understand your point. dest[b] has 0 size because there were 0 matching elements, correct ? your definition of size of dest[b] is the number of true elements.
> 
> What I found really strange with this interpretation is that the legality of the program depends on a runtime behavior
> 
> for instance if the boolean's value is not known at compile time, like with
> 
> ...
> b[0] = foo(); // with extern bool foo (void);
> dest[b] = src;
> ...

That surely isn't surprising at all, is this really dissimilar to:

vector<int> v(foo());
v[1] = 1;

Chris



More information about the Libstdc++ mailing list