Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-06-01 08:44:04
Cliff Green wrote:
> And (as I just wrote in a different e-mail), you do know the
> brittleness and maintenance burden of "casting structs" and
> sending them over the network (or writing to file)? I've
> seen developers waste days trying to figure out subtle
> problems of alignment and mismatched message sizes.
One can easily specify a field with the endian type or with the right endianness, so using the endian types doesn't preclude mistakes. However, I concede that writing procedural code to swap each field, including newly added fields, is more brittle.
Presuming that the function approach is more efficient, I can imagine writing code with the endian types and, when performance becomes an issue, switching to normal types plus swapping function calls.
Having the choice is valuable.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.