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