当前位置: 首页>>代码示例>>C++>>正文


C++ slist_type::emplace_back方法代码示例

本文整理汇总了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;
                }
开发者ID:alex85k,项目名称:osm2pgsql,代码行数:27,代码来源:segment_list.hpp

示例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;
     }
 }
开发者ID:AFDudley,项目名称:osm2pgsql,代码行数:17,代码来源:segment_list.hpp


注:本文中的slist_type::emplace_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。