"Kevin S. Van Horn" <[EMAIL PROTECTED]> writes:

> David Abrahams writes:
>
>> Looks cool. I don't usually need such a thing, though. Could you give
>> some examples of likely use cases?
>
> The impetus for bit_struct was a discussion with a local business on possible
> student library projects that would benefit the business.  This company writes
> a lot of embedded software.  They are dealing with a network protocol that
> allows them to pack any number of parameters into a message of exactly eight
                      ^^^^^^^^^^
Really?! 

> bytes.  Note that byte order within multibyte integers is an issue I
> have not addressed with bitstruct; if one wishes to send a bitstruct
> over the network, then either the sender and receiver must have the
> same integer sizes and byte orders, or you need an additional
> facility to put bytes into a standard order (like the Unix htonl,
> htons, ntohl, and ntohs functions, but templatized.)
>
> This kind of thing might also be useful in writing memory
> allocators, where you want to tightly pack information into a small
> header for a block of memory.  It might also be useful in
> implementing tagged data for dynamically-typed languages.

Thanks for the explanation.

-- 
                       David Abrahams
   [EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to