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

Christian BRUEL christian.bruel@st.com
Thu Nov 26 11:58:00 GMT 2009


what about

#include <valarray>
using namespace std;

int main(void)
{
   int n = 1;

   valarray<int>  dest(n);
   valarray<bool> b(false, n);
   valarray<int>  src(1, n);

   dest[b] = src;

   return 0;
}

is it a user error also ?

thanks

Christian

Gabriel Dos Reis wrote:
> On Thu, Nov 26, 2009 at 5:42 AM, Christian BRUEL <christian.bruel@st.com> wrote:
>>> This disposition makes your example above have an undefined behaviour.
>> this : myarray[mymask] += valarray<int>(3,n);
>>
>> is undefined ???
>> with
>> myarray = size 10
>> valrarray = size 10
>> mymask = size 10, 2 true bits.
> 
> Yes.
> 
>> oh well...
>>
>> I've recorded the original bug
>> at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42182
> 
> It should be closed as 'user error'.
> 
> -- Gaby
> 



More information about the Libstdc++ mailing list