so long as you know how many bits the target and source are you can do this.
std::bitset<16> arr("1100110011001100");std::bitset<4> v ( ((arr ) & (arr>>4 ) & (arr>>8 ) & (arr>>12)).to_ulong() & 0x0f);
so long as you know how many bits the target and source are you can do this.
std::bitset<16> arr("1100110011001100");std::bitset<4> v ( ((arr ) & (arr>>4 ) & (arr>>8 ) & (arr>>12)).to_ulong() & 0x0f);