本文整理汇总了C++中slist_type::emplace_back方法的典型用法代码示例。如果您正苦于以下问题:C++ slist_type::emplace_back方法的具体用法?C++ slist_type::emplace_back怎么用?C++ slist_type::emplace_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类slist_type
的用法示例。
在下文中一共展示了slist_type::emplace_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extract_segments_from_way_impl
uint32_t extract_segments_from_way_impl(osmium::area::ProblemReporter* problem_reporter, uint64_t& duplicate_nodes, const osmium::Way& way, role_type role) {
uint32_t invalid_locations = 0;
osmium::NodeRef previous_nr;
for (const osmium::NodeRef& nr : way.nodes()) {
if (!nr.location().valid()) {
++invalid_locations;
if (problem_reporter) {
problem_reporter->report_invalid_location(way.id(), nr.ref());
}
continue;
}
if (previous_nr.location()) {
if (previous_nr.location() != nr.location()) {
m_segments.emplace_back(previous_nr, nr, role, &way);
} else {
++duplicate_nodes;
if (problem_reporter) {
problem_reporter->report_duplicate_node(previous_nr.ref(), nr.ref(), nr.location());
}
}
}
previous_nr = nr;
}
return invalid_locations;
}
示例2: extract_segments_from_way
/**
* Extract segments from given way and add them to the list.
*
* Segments connecting two nodes with the same location (ie same
* node or different node with same location) are removed.
*
* XXX should two nodes with same location be reported?
*/
void extract_segments_from_way(const osmium::Way& way, const char* role) {
osmium::NodeRef last_nr;
for (const osmium::NodeRef& nr : way.nodes()) {
if (last_nr.location() && last_nr.location() != nr.location()) {
m_segments.emplace_back(last_nr, nr, role, &way);
}
last_nr = nr;
}
}