向量携带的 Teh 是由 id 索引的对:
<std::pair<int, std::pair<int, int>>>
496 1, 256
(message id)
如您所见,“id”是重复的。为了进一步处理这些数据,在逻辑上对我来说根据“消息 id”对该三元组进行排序非常有用。如何使用 STL 函数做到这一点?
这是一些数据示例:
15:38:08.307 - (I) ET02 - For message Id: 496 Tag - value pair: 1 - 256
15:38:08.307 - (I) ET02 - For message Id: 496 Tag - value pair: 2 - 27060
15:38:08.307 - (I) ET02 - For message Id: 496 Tag - value pair: 3 - 2014-06-16T17:07:00.519
15:38:08.307 - (I) ET02 - For message Id: 487 Tag - value pair: 1 - 1044
15:38:08.307 - (I) ET02 - For message Id: 487 Tag - value pair: 2 - 9098150000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 1 - 9098150000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 2 - 9098150000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 3 - 5902400000000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 501 - 256000000000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 502 - 0
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 503 - 0
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 504 - 9098150000
15:38:08.307 - (I) ET02 - For message Id: 498 Tag - value pair: 505 - 9098150000