1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <algorithm>
struct Word {
static const std::size_t byte_size = 8;
static const std::size_t bytes = 2;
Word() { std::fill_n(*byte, bytes * byte_size, false); }
Word(const bool* a, const bool* b)
{
std::copy(a, a + byte_size, byte[0]);
std::copy(b, b + byte_size, byte[1]);
}
private:
bool byte[bytes][byte_size];
};
int main()
{
bool a [] = { false, true, false, true, false, true, false, true };
bool b [] = { true, true, true, true, false, false, false, false };
Word word1(a, b);
Word word2;
}
|