比较请求体对象的序列号大小,根据第一个参数请求体数据类型进行区分。
最后返回两个请求体的序列号大小关系,若结果为true,第一个参数的请求对象序列号值大;若结果为false,第一个参数的请求体对象序列号值小于等于第二个参数请求体对象序列号值。
struct Compare { bool operator () (const InferRequestId &lhs, const InferRequestId &rhs) const { if (lhs.Type() == InferRequestId::DataType::STRING) { return std::hash<std::string>()(lhs.StringValue()) < std::hash<std::string>()(rhs.StringValue()); } else { return lhs.UnsignedIntValue() < rhs.UnsignedIntValue(); } } };
无。