From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-05-24 11:23:11
On Sat, May 24, 2008 at 7:45 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
> Neil Mayhew wrote:
>> The areas that I am interested in seeing more work done on are (1)
>> making constructors "conditional" and (2) adding a bit-range access method.
> Do you have a proposed design for bit-range access?
> What is the use case or motivation for bit-range access?
Perhaps something based off of erlang's Bit Syntax?
Armstrong's Erlang book gives MPEG headers as an example of bit range
access, among other things.
So something like
Or if you're writing a linker to generate EXEs for windows (another
example from Armstrong's book),
little_endian< uint_t<32> >, // Characteristics
little_endian< uint_t<32> >, // TimeDateStamp
little_endian< uint_t<16> >, // MajorVersion
little_endian< uint_t<16> >, // MinorVersion
little_endian< uint_t<16> >, // NumberOfNamedEntries
little_endian< uint_t<16> > // NumberOfIdEntries
Be fun to be able to get everything as a tuple, too, to be able to
assign to a tie, pattern-matching style
That interface works better for the bit ranges, though, I suppose,
since little_endian< uint_t<32> > as a boost.endian type on its own
would be far more convenient name-wise than having to get it through a
Just thinking out loud,