I am trying to create a bit-vector class in C++ to model some hardware. In most HDLs (hardware description langauges) that I know, specific bits are referenced like this:>
a simple struct with two members as a parameter to operator[]...
struct pos { int lsb; int msb; }; pos foo={1,2}; my_vector[foo];
or in the new standard, I believe you can simply do:
my_vector[pos{1,2}]