I'd like to set bits within a bit range given a certain value: For instance
Given a value 8hex, set the appropriate bits in the range 0..3.
Given a value 6hex, set the appropriate bits in the range 4..6
For error checking I'd like to compare the given value against the min/max value within the range.
I'm struggling to do this with std::bitset. Source code appreciated.