$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2008-05-30 07:17:09
Scott McMurray <me22.ca+boost <at> gmail.com> writes:
> std::copy( binary_buffer.begin(), binary_buffer.end(),
> reinterpret_cast<char*>(&dr) );
>
Or:
memcpy(&dr, &buffer[0], buffer.size());
Or use union to avoid making a copy:
union {
data d;
unsigned char bytes[4];
} u;
bytes[0] = 3;
bytes[1] = 6;
bytes[2] = 0;
bytes[3] = 9;
// use d.first, d.second, d.third
HTH,
Roman Perepelitsa.