Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Tomas Puverle (tomas.puverle_at_[hidden])
Date: 2010-05-28 11:30:38


> > In my version of such functionality, I have byte_order::to_host() and
byte_order::to_network()
> function templates. Those names are more in keeping with the C functions
htons, ntohs, etc.
> >
>
> +1 on the naming. No matter what the interface morphs into, "network"
> should be a valid synonym for "big_endian" for the reason stated.

Hi Rob,

I am not sure what your comment refers to exactly.

Earlier in the thread we have already established that for many users, the
"network" order may mean different things, and hence the reason why my library
doesn't prescribe one in the first place.

Are you saying that you would like it to do so? Or are you saying you would
like to have another typedef, "machine_to_network"?

I *could* add that with no problems, of course, BUT like I said, that typedef
may mean different things to different people. I would almost prefer for this
to be an application specific define, like this

//MyApp.h
//
//in our world, "network order" means little endian
typedef endian::machine_to_little hton;

and then use it later as

swap<hton>(myType)

Does that make sense to you?

Tom


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