Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-05-30 16:05:23


----- Original Message -----
From: "Terry Golubiewski" <tjgolubi_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, May 29, 2010 5:55 AM
Subject: Re: [boost] [boost::endian] Request for comments/interest

>
>
> ----- Original Message -----
> From: "vicente.botet" <vicente.botet_at_[hidden]>
> Newsgroups: gmane.comp.lib.boost.devel
> To: <boost_at_[hidden]>
> Sent: Friday, May 28, 2010 5:21 PM
> Subject: Re: [boost::endian] Request for comments/interest
>>> int main() {
>>> struct MyClass { char data[12]; };
>>>
>>> endian<little, MyClass> lil_1;
>>> endian<little, MyClass> lil_2;
>>> endian<big, MyClass> big_1;
>>>
>>> lil_1 = lil_2;
>>> big_1 = lil_1;
>>> lil_2 = big_1;
>>>
>>> } // main
>>
>> Maybe, but what about more heterogeneus structures?
>
> Ok, here's an actual example that compiles on VC9.
> (Notice how I worked in "chrono")
>
> terry
>
> template<endian_t, int w1, int w2=0, int w3=0, int w4=0, int w5=0>
> struct bitfield {
> char placeholder[(w1 + w2 + w3 + w4 + w5 + 7)/8];
> }; // bitfield
>
> namespace internet {
>
> #pragma pack(push ,1)
>
> struct IpHeader {
> bitfield<big, 4, 4> version_headerLength;
> enum { version, headerLength };
> bitfield<big, 3, 1, 1, 1, 1> differentiated_services;
> enum { precedence, low_delay, high_thruput, high_reliability,
> minimize_cost };

Hi,

We are working on a bitfield library and I'm curious in contrasting your approach and ours.
I'm interested in seen the complete code and or documentation if (available) for the bitfield part. Could you provide it?

Thanks,
Vicente


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