STL List 指针数据排序
来源:互联网 发布:中文域名在线转码工具 编辑:程序博客网 时间:2024/05/19 12:17
温故知新,前段时间做FIX打包时,由于FIX包体中对各字段排序要求严格,处理时采用LIST来保存数据。
定义每个字段采用结构,保存在LIST保存的是指针。排序起来就比较有意思了。需自己实现排序方法。
处理代码片段示例:
typedef struct stFixFieldList{ int iTag; std::string strValue; std::string strGrpNo; stFixFieldList():iTag(0){} bool operator<(const stFixFieldList& rhs)const { return iTag < rhs.iTag ? true : false; }} ST_FIX_FIELD_LIST;typedef std::list<ST_FIX_FIELD_LIST *> list_FixField;template<> struct std::greater<stFixFieldList*>{ bool operator()(const stFixFieldList* a1, const stFixFieldList* a2) const { return *a1 < *a2; }};
//排序处理
listFixBody.sort(std::greater<ST_FIX_FIELD_LIST*>())
阅读全文
0 0
- STL List 指针数据排序
- STL list 排序
- STL list 排序
- stl的list排序
- STL之list排序
- STL中的List排序问题
- STL中的List排序问题
- STL list中对象排序
- STL list中对象排序
- stl list自定义排序准则
- List集合数据排序
- list数据重排序
- STL的list链表排序
- C++中STL List排序实现
- STL中list结构体元素排序
- STL LIST中自定义排序函数例子
- STL中list的排序算法
- STL 中的List排序算法(in SGI STL)
- 高性能Mysql 3(创建高性能的索引)
- java.io.FileNotFoundException: /storage/emulated/0/ ……: open failed: EACCES (Permissi
- v-html
- 双击手机返回键弹出对话框
- ArcGIS Engine commands
- STL List 指针数据排序
- Android-PullToRefresh的使用
- webstorm入门2-配置
- BZOJ 1697: [Usaco2007 Feb]Cow Sorting牛排序 置换
- C#闭包的陷阱
- ArcGIS改变选择集选中时的样式与颜色
- NumberRunningTextView改良版
- (转)霍华德·马克斯:警惕那些人人都追捧的事物
- 进程间通信 之 消息队列(Linux)