This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]