I have a vector of bitsets
:
vector < bitset<1024> > myvector;
What is the best way to sort this vector from:
0: xxx0100
1: xxx1100
2: xxx0010
3: xxx0001
...
...
to this order:
0: xxx0001
1: xxx0010
2: xxx0100
3: xxx1100
...
...
I already tried to do this with std:sort, but it didn't work, because std:sort use the "<" - operator, which doesn't work for bitsets.
Thanks in advance for your help! Any suggestions or ideas are greatly appreciated!
EDIT:
My question is different to Sorting a vector of custom objects, because it is impossible to use "<"- operator for bitset
. So my question is, which operator can I use instead, to compare bitset
?