Boost logo

Boost :

Subject: Re: [boost] hton/ntoh template functions
From: Scott McMurray ([hidden])
Date: 2008-09-25 15:30:44

On Thu, Sep 25, 2008 at 15:03, vicente.botet <vicente.botet_at_[hidden]> wrote:
> currently most of the applications that must take care of endianess use
> ntohl/htonl ntohs/htons functions.
> When the size of the integer change we need to change between the -s and -l
> functions (or maybe remove the call for chars).

Have you looked at the proposed Boost.Endian library? It's a very
elegant way of handling things:

That said, it's a different philosophy from in-place byte swapping, so
it might not fit what you need.

Boost list run by bdawes at, gregod at, cpdaniel at, john at