This is very nice.
Thanks Beman, Scott, and other contributors to this!
I am coding it up right now. This will really, really help.
Do you mean std::copy in <algorithm>?
graham
On Thu, May 29, 2008 at 1:37 PM, Scott McMurray
On Thu, May 29, 2008 at 2:19 PM, Graham Reitz
wrote: ...would like to convert to this in a C++'ish style using a boost facility if it exists: (or consider directing me somewhere else if it doesn't)
There isn't at the moment.
However, Beman Dawes has recently updated his proposed Boost.Endian library (http://tinyurl.com/4bswsh), and there is a discussion about it over on the dev list (http://lists.boost.org/Archives/boost/2008/05/137820.php and followups).
It would allow you to say (something like)
struct // or class { boost::endian::uint_t<16, boost::endian::big_endian> first; boost::endian::uint_t<32, boost::endian::big_endian> second; } data;
Which you could then std::copy your data into (through char*s), and use the implicit conversions to get native integral types out.
HTH, ~ Scott _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users