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 Thu, Nov 26, 2009 at 4:31 AM, Christian BRUEL <christian.bruel@st.com> wrote:
>> the issue is only whether it makes sense to allow for a right hand data
>> larger than that.
>
> I don't understand why you see this as an issue. if you have 2 true elements
> in the mask array, the elements in the source array (if bigger than 2) will
> be after the first 2 selected will just be ignored.

Why do you want that behaviour?

>
> so
> myarray[mymask] += valarray<int>(3,2);
> and
> myarray[mymask] += valarray<int>(3,10);
>
> with 2 true elements ?and myarray of size n
>
> are equivalent because with the current implementation, but the former one
> is legal is not the first one, so it could work, or not.

No, they are not.  The first is well defined, the second is not.

-- Gaby


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