Quantcast
Viewing latest article 4
Browse Latest Browse All 4

C++ Do operation on bits of a std::bitset

I want to AND 4 4-bits of a std::bitset<16> with each other. I mean:

std::bitset<16> arr("1100 1100 1100 1100");

I want to AND these 4-bits array.

std::bitset<4> a;

a= 1100 & 1100 & 1100 & 1100

I want to do this in the most efficient way. Not using for loops.

Thanks in Advance.


Viewing latest article 4
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>