我有一个位集
的向量:
vector < bitset<1024> > myvector;
从这个顺序:
到这个顺序的最佳排序方式是什么:0: xxx0100
1: xxx1100
2: xxx0010
3: xxx0001
...
...
我已经尝试使用std:sort来做到这一点,但它没有成功,因为std:sort使用“<”- 运算符,而该运算符无法用于位集。0: xxx0001
1: xxx0010
2: xxx0100
3: xxx1100
...
...
先感谢您的帮助!非常感谢任何建议或想法!
编辑: 我的问题与Sorting a vector of custom objects不同,因为对于bitset,不可能使用“<”- 运算符。所以我的问题是,我可以使用哪个运算符来比较bitset?