Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-05-30 17:32:08


----- Original Message -----
From: "Tomas Puverle" <Tomas.Puverle_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, May 30, 2010 2:40 AM
Subject: Re: [boost] [boost::endian] Request for comments/interest

>
> Vincente,
>
>> This is not completly true, as your implementation will at least visit the
> instance.
>
> As Dave already pointed out, it *actually* is completely true. In the case
> when nothing is supposed to happen, nothing happens - please refer to the
> implementation.
> If you still have doubts afterwards, we can discuss it further.

Oh, I see. In fact your structurs are either formatted with a specific endianess for all the fields. This is usualy the case, but in the general case you will need to format some fields in big endian and other in litle endian. Messages as for example the posted by Terry, which mixes little and big endian, can not be formatted by your library without visiting each field and some of them will be a no_op while others will be swap_op.

This was the reason I said: "This is not completly true, as your implementation will at least visit the instance".

If all the fields of your message have an uniform endianess, then you don't need to visit the structure and your swap in place can do nothing if the endianess match.

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk