本文整理汇总了C++中Filters::emplace_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Filters::emplace_back方法的具体用法?C++ Filters::emplace_back怎么用?C++ Filters::emplace_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filters
的用法示例。
在下文中一共展示了Filters::emplace_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: search_reply_push_filters
void search_reply_push_filters(SharedPtrData reply, void *filters_json, void *filter_state_json, char **error) {
#if UNITY_SCOPES_VERSION_MAJOR == 0 && (UNITY_SCOPES_VERSION_MINOR < 6 || (UNITY_SCOPES_VERSION_MINOR == 6 && UNITY_SCOPES_VERSION_MICRO < 10))
std::string errorMessage = "SearchReply.PushFilters() is only available when compiled against libunity-scopes >= 0.6.10";
*error = strdup(errorMessage.c_str());
std::cerr << errorMessage << std::endl;
#else
try {
Variant filters_var = Variant::deserialize_json(from_gostring(filters_json));
Variant filter_state_var = Variant::deserialize_json(from_gostring(filter_state_json));
Filters filters;
for (const auto &f : filters_var.get_array()) {
filters.emplace_back(FilterBase::deserialize(f.get_dict()));
}
auto filter_state = FilterState::deserialize(filter_state_var.get_dict());
get_ptr<SearchReply>(reply)->push(filters, filter_state);
} catch (const std::exception &e) {
*error = strdup(e.what());
}
#endif
}