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

Christian BRUEL christian.bruel@st.com
Fri Nov 27 09:29:00 GMT 2009


If you want a complete example of how this is used this you can check 
the example 14-22 at 
http://www.linux-kheops.com/doc/casteyde/cours_cpp-1.40.1/htm/x5866.htm#AEN6045

that segfaults with g++

because the computed assignment is between a source and a destination 
that have different sizes. It's a user error so easy to step into I 
guess. The Standard didn't make this point very intuitive.

Cheers

Christian


Gabriel Dos Reis wrote:
> On Fri, Nov 27, 2009 at 3:02 AM, Christian BRUEL <christian.bruel@st.com> wrote:
>> Now that you established that it was a user bug, just wanted to slightly
>> correct the problem characterization by fixing the code with
>>
>>  b[0] = foo();
>>  dest[b] = src[b];
>>
>> so the problem was the "this" size really, not the runtime dependency on
>> foo(). Hope this could be of interest (regarding all the bogus examples I
>> found including the computed assignment variation).
> 
> Are you still having a problem with that?  If yes, could
> you send a minimal complete program?
> 
> -- Gaby
> 



More information about the Libstdc++ mailing list