c++ - how to convert protobuf repeated message to std::set -
my message defines this
message connection { optional string id = 1; ... } message configurations { repeated connection connections = 1; ... }
there 2 configurations, , want union\intersection\difference, plan convert repeated message std::set, this:
bool comp(const connection &first, const connection &sec) { return first.id() < sec.id(); } std::set <connection, comp> new_set( conf.connections().begin(), conf.connections().end());
but not work, tried other ways, failed. fresh man cpp, think coming stackoverflow more effective way. tips? thanks.
Comments
Post a Comment