octave-maintainers
[Top][All Lists]
Advanced

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

Re: Octave on windows testing


From: Olaf Till
Subject: Re: Octave on windows testing
Date: Sat, 12 Mar 2016 19:14:02 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Mar 11, 2016 at 05:15:21PM -0500, John W. Eaton wrote:
> ...
> So I think that asking whether you are using GCC is the wrong question to
> ask.

On Fri, Mar 11, 2016 at 05:09:06PM -0500, John W. Eaton wrote:
> 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.

I think I can change the code to use std::ostringstream instead of
std::vector<char>. Thanks for the hints.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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