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)


Hi,

to be honest I'm not at all convinced the testcase you are proposing is
consistent with our interpretation of the Standard: as I remember the
issue, the source array is supposed to have exactly as many elements as
the true booleans on the left side, thus only a testcase with
   
    myarray[mymask] += valarray<int>(3,0);

and
   
    myarray[mymask] += valarray<int>(3,2);

respectively, is guaranteed to work fine.  I understand however that it
would be convenient to allow for a larger right hand side array, makes
easier writing this kind of code, Gaby has the last word, if he believes
that it can be implemented in a safe and consistent way wrt the rest of
valarray, I have no objections of course to your patch. In case,
remember to also add to the testsuite the other testcase I sent the last
time, and format and style both properly, see the other testcases in the
tessuite for examples, thus: separate test01 function called from main,
a test variable on top with attribute unused, VERIFY( XX ), not VERIFY
(XX), in general function calls like f(y), not f (y), etc.

Paolo.


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