Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-05-27 10:29:40


vicente.botet wrote:
> Rob Stewart wrote:
>
> > I don't see any type safety problems in my original or
> > hybrid APIs.
>
> The problem is that we don't know the endiannes of the types
> int32_t or long. This depends on the operation you have
> performed on your code. E.g.

Endianness is not part of the type, so referring to type safety mislead me.

> int32_t wire(/* from wire */);
> long l1;
> long l2;
> to_big_endian(l1, l2);
> to_big_endian(l2, wire);
>
> With the typed endians this is not possible.
> big32_t wire(/* from wire */);
> long l1;
> long l2;
> l2=l1; // no endian change as both are native
> wire=l2; // conversion to big from native.

That's a sensible concern and reason to provide such types (without the operators) along with the less safe functions.

_____
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.


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