octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave on windows testing


From: John W. Eaton
Subject: Re: Octave on windows testing
Date: Fri, 11 Mar 2016 17:09:06 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

On 03/11/2016 04:35 PM, Olaf Till wrote:

I have a std::vector<char>, which is appended to and inserted to by
several callback functions. The appended and inserted objects are of
different types and sizes. Example (changed):

char_vector.resize (char_vector.size () + 4);
*((uint32_t *) &(char_vector.end ()[-4])) = uint32_value;

Well, now that I think about it again, I could use memcpy instead of
direct assignments into the vector. But this would mean a function may
be called where otherwise e.g. only an integer assignment would be
necessary...

When I see things like this, I immediately think that there must be a better way that is cleaner and doesn't rely on casting tricks or special noalias flags or whatever.

jwe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]