New paper: N3620, Network Byte Order Conversion -- Kyle Kloepper

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3620

Date: 2013-03-18

Network Byte Order Conversion

by Kyle Kloepper

Excerpt:

This proposal adds support to C++ for converting between host and network byte order.

Add a Comment

Comments are closed.

Comments (3)

0 0

FaTony said on Mar 19, 2013 05:41 PM:

Why this proposal is restricted to unsigned integer types?
1 0

Gregor said on May 5, 2013 02:54 PM:

It would be useful to have also byte swapping from host to big and little endian.

As far as I remember the AIM chat protocol for example uses little endian for the on wire format. And all protocols where someone on LE forgot to convert to network byte order uses LE, too.

Bonus points for a plain swap.
0 0

FaTony said on May 6, 2013 01:47 AM:

@Gregor, I think this would go beyond the portable territory. Remember that so far there's no guaranteed number of bits in a byte and no mention of endianness at all.

I think abstract host and network byte orders are ok as long as they are completely implementation defined. Anything beyond that is unacceptable.