常用函数

rsp.cid_extra_meta

sortMap

std::vector> pairs;
            for(auto iter =m.begin(); iter != m.end();iter++){
                int64_t k = iter->first;
                int64_t rank = iter->second;
                pairs.push_back(std::make_pair(k,rank));
                
            }
            std::sort(pairs.begin(),pairs.end(),[](std::pair&l ,std::pair& r){return l.second < r.second;});
 
            for(auto iter = pairs.begin();iter != pairs.end() && cnt ++ < 10;iter++){
                   LOGF_INFO("[%s][ServiceTarget]cidrank=cid:%ld rank: %ld", user_context.logid().c_str(), iter->first,iter->second);
            }
        

你可能感兴趣的:(常用函数)