diff --git a/contrib/libosmium/README.contrib b/contrib/libosmium/README.contrib index 997cc5923..955da97f3 100644 --- a/contrib/libosmium/README.contrib +++ b/contrib/libosmium/README.contrib @@ -1,2 +1,2 @@ Source: https://github.com/osmcode/libosmium -Revision: v2.21.0 +Revision: v2.22.0 diff --git a/contrib/libosmium/README.md b/contrib/libosmium/README.md index 4d73ed7a8..29b86f4a4 100644 --- a/contrib/libosmium/README.md +++ b/contrib/libosmium/README.md @@ -6,7 +6,7 @@ A fast and flexible C++ library for working with OpenStreetMap data. Libosmium works on Linux, macOS and Windows. -[![Github Build Status](https://github.com/osmcode/libosmium/workflows/CI/badge.svg?branch=master)](https://github.com/osmcode/libosmium/actions) +[![Build Status](https://github.com/osmcode/libosmium/actions/workflows/ci.yml/badge.svg)](https://github.com/osmcode/libosmium/actions) [![Packaging status](https://repology.org/badge/tiny-repos/libosmium.svg)](https://repology.org/metapackage/libosmium) Please see the [Libosmium manual](https://osmcode.org/libosmium/manual.html) @@ -15,8 +15,7 @@ for more details than this README can provide. ## Prerequisites -You need a C++11 compiler and standard C++ library. Osmium needs at least GCC -4.8 or clang (LLVM) 3.4. (Some parts may work with older versions.) +You need a C++14 compiler and standard C++ library. Different parts of Libosmium (and the applications built on top of it) need different libraries. You DO NOT NEED to install all of them, just install those diff --git a/contrib/libosmium/include/osmium/area/detail/segment_list.hpp b/contrib/libosmium/include/osmium/area/detail/segment_list.hpp index 9f0e4c4f8..ed07fe198 100644 --- a/contrib/libosmium/include/osmium/area/detail/segment_list.hpp +++ b/contrib/libosmium/include/osmium/area/detail/segment_list.hpp @@ -50,6 +50,7 @@ DEALINGS IN THE SOFTWARE. #include #include #include +#include #include namespace osmium { @@ -64,13 +65,13 @@ namespace osmium { * way as parameter. This takes into account that there might be * non-way members in the relation. */ - template - inline void for_each_member(const osmium::Relation& relation, const std::vector& ways, F&& func) { + template + inline void for_each_member(const osmium::Relation& relation, const std::vector& ways, TFunc&& func) { auto way_it = ways.cbegin(); for (const osmium::RelationMember& member : relation.members()) { if (member.type() == osmium::item_type::way) { assert(way_it != ways.cend()); - func(member, **way_it); + std::forward(func)(member, **way_it); ++way_it; } } diff --git a/contrib/libosmium/include/osmium/index/relations_map.hpp b/contrib/libosmium/include/osmium/index/relations_map.hpp index 2cfcfc93b..57a214968 100644 --- a/contrib/libosmium/include/osmium/index/relations_map.hpp +++ b/contrib/libosmium/include/osmium/index/relations_map.hpp @@ -41,6 +41,7 @@ DEALINGS IN THE SOFTWARE. #include #include #include +#include #include #include #include @@ -137,8 +138,25 @@ namespace osmium { m_map.reserve(size); } + void clear() { + m_map.clear(); + m_map.shrink_to_fit(); + } + + typename std::vector::const_iterator begin() const noexcept { + return m_map.cbegin(); + } + + typename std::vector::const_iterator end() const noexcept { + return m_map.cend(); + } + }; // class flat_map + template + using rel_index_map_type = detail::flat_map; + } // namespace detail /** @@ -171,13 +189,17 @@ namespace osmium { friend class RelationsMapStash; friend class RelationsMapIndexes; - using map_type = detail::flat_map; + detail::rel_index_map_type m_map32; + detail::rel_index_map_type m_map64; - map_type m_map; + bool m_small; - explicit RelationsMapIndex(map_type&& map) : - m_map(std::move(map)) { + explicit RelationsMapIndex(detail::rel_index_map_type&& map) : + m_map32(std::move(map)), m_small(true) { + } + + explicit RelationsMapIndex(detail::rel_index_map_type&& map) : + m_map64(std::move(map)), m_small(false) { } public: @@ -187,35 +209,11 @@ namespace osmium { RelationsMapIndex(const RelationsMapIndex&) = delete; RelationsMapIndex& operator=(const RelationsMapIndex&) = delete; - RelationsMapIndex(RelationsMapIndex&& /*other*/) noexcept(std::is_nothrow_move_constructible::value); - RelationsMapIndex& operator=(RelationsMapIndex&& /*other*/) noexcept(std::is_nothrow_move_assignable::value); + RelationsMapIndex(RelationsMapIndex&& /*other*/) noexcept; + RelationsMapIndex& operator=(RelationsMapIndex&& /*other*/) noexcept; ~RelationsMapIndex() noexcept = default; - /** - * Find the given relation id in the index and call the given - * function with all parent relation ids. - * - * @code - * osmium::unsigned_object_id_type member_id = 17; - * index.for_each_parent(member_id, [](osmium::unsigned_object_id_type id) { - * ... - * }); - * @endcode - * - * @deprecated Use for_each() instead. - * - * Complexity: Logarithmic in the number of elements in the index. - * (Lookup uses binary search.) - */ - template - void for_each_parent(const osmium::unsigned_object_id_type member_id, TFunc&& func) const { - const auto parents = m_map.get(member_id); - for (auto it = parents.first; it != parents.second; ++it) { - func(it->value); - } - } - /** * Find the given relation id in the index and call the given * function with all related relation ids. @@ -232,9 +230,16 @@ namespace osmium { */ template void for_each(const osmium::unsigned_object_id_type id, TFunc&& func) const { - const auto parents = m_map.get(id); - for (auto it = parents.first; it != parents.second; ++it) { - func(it->value); + if (m_small) { + const auto parents = m_map32.get(id); + for (auto it = parents.first; it != parents.second; ++it) { + std::forward(func)(it->value); + } + } else { + const auto parents = m_map64.get(id); + for (auto it = parents.first; it != parents.second; ++it) { + std::forward(func)(it->value); + } } } @@ -244,7 +249,7 @@ namespace osmium { * Complexity: Constant. */ bool empty() const noexcept { - return m_map.empty(); + return m_small ? m_map32.empty() : m_map64.empty(); } /** @@ -253,15 +258,15 @@ namespace osmium { * Complexity: Constant. */ std::size_t size() const noexcept { - return m_map.size(); + return m_small ? m_map32.size() : m_map64.size(); } }; // class RelationsMapIndex // defined outside the class on purpose // see https://akrzemi1.wordpress.com/2015/09/11/declaring-the-move-constructor/ - inline RelationsMapIndex::RelationsMapIndex(RelationsMapIndex&&) noexcept(std::is_nothrow_move_constructible::value) = default; // NOLINT(readability-redundant-inline-specifier) - inline RelationsMapIndex& RelationsMapIndex::operator=(RelationsMapIndex&&) noexcept(std::is_nothrow_move_assignable::value) = default; // NOLINT(readability-redundant-inline-specifier) + inline RelationsMapIndex::RelationsMapIndex(RelationsMapIndex&&) noexcept = default; // NOLINT(readability-redundant-inline-specifier) + inline RelationsMapIndex& RelationsMapIndex::operator=(RelationsMapIndex&&) noexcept = default; // NOLINT(readability-redundant-inline-specifier) class RelationsMapIndexes { @@ -270,7 +275,12 @@ namespace osmium { RelationsMapIndex m_member_to_parent; RelationsMapIndex m_parent_to_member; - RelationsMapIndexes(RelationsMapIndex::map_type&& map1, RelationsMapIndex::map_type&& map2) : + RelationsMapIndexes(detail::rel_index_map_type&& map1, detail::rel_index_map_type&& map2) : + m_member_to_parent(std::move(map1)), + m_parent_to_member(std::move(map2)) { + } + + RelationsMapIndexes(detail::rel_index_map_type&& map1, detail::rel_index_map_type&& map2) : m_member_to_parent(std::move(map1)), m_parent_to_member(std::move(map2)) { } @@ -312,15 +322,23 @@ namespace osmium { */ class RelationsMapStash { - using map_type = detail::flat_map; - - map_type m_map; + detail::rel_index_map_type m_map32; + detail::rel_index_map_type m_map64; #ifndef NDEBUG bool m_valid = true; #endif + static void append32to64(detail::rel_index_map_type& map32, detail::rel_index_map_type& map64) { + map64.sort_unique(); + map64.reserve(map64.size() + map32.size()); + for (const auto& item : map32) { + map64.set(item.key, item.value); + } + map64.sort_unique(); + map32.clear(); + } + public: RelationsMapStash() = default; @@ -328,8 +346,8 @@ namespace osmium { RelationsMapStash(const RelationsMapStash&) = delete; RelationsMapStash& operator=(const RelationsMapStash&) = delete; - RelationsMapStash(RelationsMapStash&& /*other*/) noexcept(std::is_nothrow_move_constructible::value); - RelationsMapStash& operator=(RelationsMapStash&& /*other*/) noexcept(std::is_nothrow_move_assignable::value); + RelationsMapStash(RelationsMapStash&& /*other*/) noexcept; + RelationsMapStash& operator=(RelationsMapStash&& /*other*/) noexcept; ~RelationsMapStash() noexcept = default; @@ -338,7 +356,12 @@ namespace osmium { */ void add(const osmium::unsigned_object_id_type member_id, const osmium::unsigned_object_id_type relation_id) { assert(m_valid && "You can't use the RelationsMap any more after calling build_index()"); - m_map.set(member_id, relation_id); + constexpr const osmium::unsigned_object_id_type max32 = std::numeric_limits::max(); + if (member_id <= max32 && relation_id <= max32) { + m_map32.set(member_id, relation_id); + } else { + m_map64.set(member_id, relation_id); + } } /** @@ -348,7 +371,7 @@ namespace osmium { assert(m_valid && "You can't use the RelationsMap any more after calling build_index()"); for (const auto& member : relation.members()) { if (member.type() == osmium::item_type::relation) { - m_map.set(member.positive_ref(), relation.positive_id()); + add(member.positive_ref(), relation.positive_id()); } } } @@ -360,7 +383,7 @@ namespace osmium { */ bool empty() const noexcept { assert(m_valid && "You can't use the RelationsMap any more after calling build_index()"); - return m_map.empty(); + return m_map32.empty() && m_map64.empty(); } /** @@ -370,24 +393,17 @@ namespace osmium { */ std::size_t size() const noexcept { assert(m_valid && "You can't use the RelationsMap any more after calling build_index()"); - return m_map.size(); + return m_map32.size() + m_map64.size(); } /** - * Build an index for member to parent lookups from the contents - * of this stash and return it. + * How many "small" and "large" entries are in this stash? + * For tests and debugging only! * - * After you get the index you can not use the stash any more! - * - * @deprecated Use build_member_to_parent_index() instead. + * Complexity: Constant. */ - RelationsMapIndex build_index() { - assert(m_valid && "You can't use the RelationsMap any more after calling build_index()"); - m_map.sort_unique(); -#ifndef NDEBUG - m_valid = false; -#endif - return RelationsMapIndex{std::move(m_map)}; + std::pair sizes() const noexcept { + return std::make_pair(m_map32.size(), m_map64.size()); } /** @@ -398,11 +414,17 @@ namespace osmium { */ RelationsMapIndex build_member_to_parent_index() { assert(m_valid && "You can't use the RelationsMap any more after calling build_member_to_parent_index()"); - m_map.sort_unique(); #ifndef NDEBUG m_valid = false; #endif - return RelationsMapIndex{std::move(m_map)}; + m_map32.sort_unique(); + if (m_map64.empty()) { + return RelationsMapIndex{std::move(m_map32)}; + } + + append32to64(m_map32, m_map64); + + return RelationsMapIndex{std::move(m_map64)}; } /** @@ -413,12 +435,19 @@ namespace osmium { */ RelationsMapIndex build_parent_to_member_index() { assert(m_valid && "You can't use the RelationsMap any more after calling build_parent_to_member_index()"); - m_map.flip_in_place(); - m_map.sort_unique(); #ifndef NDEBUG m_valid = false; #endif - return RelationsMapIndex{std::move(m_map)}; + m_map32.flip_in_place(); + m_map32.sort_unique(); + if (m_map64.empty()) { + return RelationsMapIndex{std::move(m_map32)}; + } + + m_map64.flip_in_place(); + append32to64(m_map32, m_map64); + + return RelationsMapIndex{std::move(m_map64)}; } /** @@ -429,21 +458,29 @@ namespace osmium { */ RelationsMapIndexes build_indexes() { assert(m_valid && "You can't use the RelationsMap any more after calling build_indexes()"); - auto reverse_map = m_map.flip_copy(); - reverse_map.sort_unique(); - m_map.sort_unique(); #ifndef NDEBUG m_valid = false; #endif - return RelationsMapIndexes{std::move(m_map), std::move(reverse_map)}; + auto reverse_map32 = m_map32.flip_copy(); + reverse_map32.sort_unique(); + m_map32.sort_unique(); + if (m_map64.empty()) { + return RelationsMapIndexes{std::move(m_map32), std::move(reverse_map32)}; + } + + auto reverse_map64 = m_map64.flip_copy(); + append32to64(reverse_map32, reverse_map64); + append32to64(m_map32, m_map64); + + return RelationsMapIndexes{std::move(m_map64), std::move(reverse_map64)}; } }; // class RelationsMapStash // defined outside the class on purpose // see https://akrzemi1.wordpress.com/2015/09/11/declaring-the-move-constructor/ - inline RelationsMapStash::RelationsMapStash(RelationsMapStash&&) noexcept(std::is_nothrow_move_constructible::value) = default; // NOLINT(readability-redundant-inline-specifier) - inline RelationsMapStash& RelationsMapStash::operator=(RelationsMapStash&&) noexcept(std::is_nothrow_move_assignable::value) = default; // NOLINT(readability-redundant-inline-specifier) + inline RelationsMapStash::RelationsMapStash(RelationsMapStash&&) noexcept = default; // NOLINT(readability-redundant-inline-specifier) + inline RelationsMapStash& RelationsMapStash::operator=(RelationsMapStash&&) noexcept = default; // NOLINT(readability-redundant-inline-specifier) } // namespace index diff --git a/contrib/libosmium/include/osmium/io/detail/read_thread.hpp b/contrib/libosmium/include/osmium/io/detail/read_thread.hpp index e0077585b..cf92440df 100644 --- a/contrib/libosmium/include/osmium/io/detail/read_thread.hpp +++ b/contrib/libosmium/include/osmium/io/detail/read_thread.hpp @@ -106,7 +106,7 @@ namespace osmium { ~ReadThreadManager() noexcept { try { close(); - } catch (...) { + } catch (...) { // NOLINT(bugprone-empty-catch) // Ignore any exceptions because destructor must not throw. } } diff --git a/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp b/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp index 9ee85dee5..bf5e8c61f 100644 --- a/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp +++ b/contrib/libosmium/include/osmium/io/detail/xml_input_format.hpp @@ -179,7 +179,7 @@ namespace osmium { return; } try { - func(xml_parser); + std::forward(func)(xml_parser); } catch (...) { m_exception_ptr = std::current_exception(); XML_StopParser(m_parser, 0); @@ -267,10 +267,10 @@ namespace osmium { ExpatXMLParser* m_expat_xml_parser{nullptr}; - template - static void check_attributes(const XML_Char** attrs, T&& check) { + template + static void check_attributes(const XML_Char** attrs, TFunc&& check) { while (*attrs) { - check(attrs[0], attrs[1]); + std::forward(check)(attrs[0], attrs[1]); attrs += 2; } } diff --git a/contrib/libosmium/include/osmium/io/reader.hpp b/contrib/libosmium/include/osmium/io/reader.hpp index d6680555d..2e63bc6b1 100644 --- a/contrib/libosmium/include/osmium/io/reader.hpp +++ b/contrib/libosmium/include/osmium/io/reader.hpp @@ -327,7 +327,7 @@ namespace osmium { m_osmdata_queue(detail::get_osmdata_queue_size(), "parser_results"), m_osmdata_queue_wrapper(m_osmdata_queue) { - (void)std::initializer_list{(set_option(args), 0)...}; + (void)std::initializer_list{(set_option(std::forward(args)), 0)...}; if (!m_pool) { m_pool = &thread::Pool::default_instance(); @@ -390,7 +390,7 @@ namespace osmium { try { m_read_thread_manager.close(); - } catch (...) { + } catch (...) { // NOLINT(bugprone-empty-catch) // Ignore any exceptions. } diff --git a/contrib/libosmium/include/osmium/io/writer.hpp b/contrib/libosmium/include/osmium/io/writer.hpp index ecd4ea473..52346a379 100644 --- a/contrib/libosmium/include/osmium/io/writer.hpp +++ b/contrib/libosmium/include/osmium/io/writer.hpp @@ -269,7 +269,7 @@ namespace osmium { assert(!m_file.buffer()); // XXX can't handle pseudo-files options_type options; - (void)std::initializer_list{(set_option(options, args), 0)...}; + (void)std::initializer_list{(set_option(options, std::forward(args)), 0)...}; if (!options.pool) { options.pool = &thread::Pool::default_instance(); diff --git a/contrib/libosmium/include/osmium/relations/members_database.hpp b/contrib/libosmium/include/osmium/relations/members_database.hpp index 36f205d12..1702658de 100644 --- a/contrib/libosmium/include/osmium/relations/members_database.hpp +++ b/contrib/libosmium/include/osmium/relations/members_database.hpp @@ -46,6 +46,7 @@ DEALINGS IN THE SOFTWARE. #include #include #include +#include #include namespace osmium { @@ -384,7 +385,7 @@ namespace osmium { rel_handle.decrement_members(); if (rel_handle.has_all_members()) { - func(rel_handle); + std::forward(func)(rel_handle); } } diff --git a/contrib/libosmium/include/osmium/relations/relations_database.hpp b/contrib/libosmium/include/osmium/relations/relations_database.hpp index a3b8573a8..e31d237e0 100644 --- a/contrib/libosmium/include/osmium/relations/relations_database.hpp +++ b/contrib/libosmium/include/osmium/relations/relations_database.hpp @@ -323,7 +323,7 @@ namespace osmium { void RelationsDatabase::for_each_relation(TFunc&& func) { for (std::size_t pos = 0; pos < m_elements.size(); ++pos) { if (m_elements[pos].handle.valid()) { - func(RelationHandle{this, pos}); + std::forward(func)(RelationHandle{this, pos}); } } } diff --git a/contrib/libosmium/include/osmium/tags/regex_filter.hpp b/contrib/libosmium/include/osmium/tags/regex_filter.hpp deleted file mode 100644 index f741c31b3..000000000 --- a/contrib/libosmium/include/osmium/tags/regex_filter.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef OSMIUM_TAGS_REGEX_FILTER_HPP -#define OSMIUM_TAGS_REGEX_FILTER_HPP - -/* - -This file is part of Osmium (https://osmcode.org/libosmium). - -Copyright 2013-2025 Jochen Topf and others (see README). - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -*/ - -#include - -#include -#include - -namespace osmium { - - namespace tags { - - template <> - struct match_key { - bool operator()(const std::regex& rule_key, const char* tag_key) const { - return std::regex_match(tag_key, rule_key); - } - }; // struct match_key - - template <> - struct match_value { - bool operator()(const std::regex& rule_value, const char* tag_value) const { - return std::regex_match(tag_value, rule_value); - } - }; // struct match_value - - /// @deprecated Use osmium::TagsFilter instead. - using RegexFilter = Filter; - - } // namespace tags - -} // namespace osmium - -#endif // OSMIUM_TAGS_REGEX_FILTER_HPP diff --git a/contrib/libosmium/include/osmium/util/progress_bar.hpp b/contrib/libosmium/include/osmium/util/progress_bar.hpp index 13a6f0c36..2329bdaa8 100644 --- a/contrib/libosmium/include/osmium/util/progress_bar.hpp +++ b/contrib/libosmium/include/osmium/util/progress_bar.hpp @@ -132,7 +132,7 @@ namespace osmium { if (m_do_cleanup) { try { done(); - } catch (...) { + } catch (...) { // NOLINT(bugprone-empty-catch) // Swallow any exceptions, because a destructor should // not throw. } diff --git a/contrib/libosmium/include/osmium/util/string_matcher.hpp b/contrib/libosmium/include/osmium/util/string_matcher.hpp index 7a87cba0c..1d11e1926 100644 --- a/contrib/libosmium/include/osmium/util/string_matcher.hpp +++ b/contrib/libosmium/include/osmium/util/string_matcher.hpp @@ -54,30 +54,6 @@ DEALINGS IN THE SOFTWARE. # include #endif - -// std::regex isn't implemented properly in glibc++ (before the version -// delivered with GCC 4.9) and libc++ before the version 3.6, so the use is -// disabled by these checks. Checks for GLIBC were based on -// https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions -// Checks for libc++ are simply based on compiler defines. This is probably -// not optimal but seems to work for now. -#if defined(__GLIBCXX__) -# if ((__cplusplus >= 201402L) || \ - defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \ - defined(_GLIBCXX_REGEX_STATE_LIMIT)) -# define OSMIUM_WITH_REGEX -# else -# pragma message("Disabling regex functionality. See source code for info.") -# endif -#elif defined(__clang__) -# if ((__clang_major__ > 3) || \ - (__clang_minor__ == 3 && __clang_minor__ > 5)) -# define OSMIUM_WITH_REGEX -# else -# pragma message("Disabling regex functionality") -# endif -#endif - namespace osmium { /** @@ -211,7 +187,6 @@ namespace osmium { }; // class substring -#ifdef OSMIUM_WITH_REGEX /** * Matches if the test string matches the regular expression. */ @@ -235,7 +210,6 @@ namespace osmium { } }; // class regex -#endif /** * Matches if the test string is equal to any of the stored strings. @@ -293,9 +267,7 @@ namespace osmium { equal, prefix, substring, -#ifdef OSMIUM_WITH_REGEX regex, -#endif list>; matcher_type m_matcher; @@ -388,7 +360,6 @@ namespace osmium { m_matcher(equal{str}) { } -#ifdef OSMIUM_WITH_REGEX /** * Create a string matcher that will match the specified regex. * Shortcut for @@ -398,7 +369,6 @@ namespace osmium { StringMatcher(const std::regex& aregex) : // NOLINT(google-explicit-constructor, hicpp-explicit-conversions) m_matcher(regex{aregex}) { } -#endif /** * Create a string matcher that will match if any of the strings diff --git a/contrib/libosmium/include/osmium/version.hpp b/contrib/libosmium/include/osmium/version.hpp index 55d4ac103..585f999e2 100644 --- a/contrib/libosmium/include/osmium/version.hpp +++ b/contrib/libosmium/include/osmium/version.hpp @@ -37,11 +37,11 @@ DEALINGS IN THE SOFTWARE. #define LIBOSMIUM_VERSION_MAJOR 2 // NOLINTNEXTLINE(modernize-macro-to-enum) -#define LIBOSMIUM_VERSION_MINOR 21 +#define LIBOSMIUM_VERSION_MINOR 22 // NOLINTNEXTLINE(modernize-macro-to-enum) #define LIBOSMIUM_VERSION_PATCH 0 -#define LIBOSMIUM_VERSION_STRING "2.21.0" +#define LIBOSMIUM_VERSION_STRING "2.22.0" #endif // OSMIUM_VERSION_HPP diff --git a/contrib/libosmium/include/osmium/visitor.hpp b/contrib/libosmium/include/osmium/visitor.hpp index 9b0320c96..fdd5ce1c7 100644 --- a/contrib/libosmium/include/osmium/visitor.hpp +++ b/contrib/libosmium/include/osmium/visitor.hpp @@ -57,42 +57,42 @@ namespace osmium { case osmium::item_type::undefined: break; case osmium::item_type::node: - handler.osm_object(static_cast&>(item)); - handler.node(static_cast&>(item)); + std::forward(handler).osm_object(static_cast&>(item)); + std::forward(handler).node(static_cast&>(item)); break; case osmium::item_type::way: - handler.osm_object(static_cast&>(item)); - handler.way(static_cast&>(item)); + std::forward(handler).osm_object(static_cast&>(item)); + std::forward(handler).way(static_cast&>(item)); break; case osmium::item_type::relation: - handler.osm_object(static_cast&>(item)); - handler.relation(static_cast&>(item)); + std::forward(handler).osm_object(static_cast&>(item)); + std::forward(handler).relation(static_cast&>(item)); break; case osmium::item_type::area: - handler.osm_object(static_cast&>(item)); - handler.area(static_cast&>(item)); + std::forward(handler).osm_object(static_cast&>(item)); + std::forward(handler).area(static_cast&>(item)); break; case osmium::item_type::changeset: - handler.changeset(static_cast&>(item)); + std::forward(handler).changeset(static_cast&>(item)); break; case osmium::item_type::tag_list: - handler.tag_list(static_cast&>(item)); + std::forward(handler).tag_list(static_cast&>(item)); break; case osmium::item_type::way_node_list: - handler.way_node_list(static_cast&>(item)); + std::forward(handler).way_node_list(static_cast&>(item)); break; case osmium::item_type::relation_member_list: case osmium::item_type::relation_member_list_with_full_members: - handler.relation_member_list(static_cast&>(item)); + std::forward(handler).relation_member_list(static_cast&>(item)); break; case osmium::item_type::outer_ring: - handler.outer_ring(static_cast&>(item)); + std::forward(handler).outer_ring(static_cast&>(item)); break; case osmium::item_type::inner_ring: - handler.inner_ring(static_cast&>(item)); + std::forward(handler).inner_ring(static_cast&>(item)); break; case osmium::item_type::changeset_discussion: - handler.changeset_discussion(static_cast&>(item)); + std::forward(handler).changeset_discussion(static_cast&>(item)); break; } } @@ -101,23 +101,23 @@ namespace osmium { inline void apply_item_impl(const osmium::OSMEntity& item, THandler&& handler) { switch (item.type()) { case osmium::item_type::node: - handler.osm_object(static_cast(item)); - handler.node(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).node(static_cast(item)); break; case osmium::item_type::way: - handler.osm_object(static_cast(item)); - handler.way(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).way(static_cast(item)); break; case osmium::item_type::relation: - handler.osm_object(static_cast(item)); - handler.relation(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).relation(static_cast(item)); break; case osmium::item_type::area: - handler.osm_object(static_cast(item)); - handler.area(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).area(static_cast(item)); break; case osmium::item_type::changeset: - handler.changeset(static_cast(item)); + std::forward(handler).changeset(static_cast(item)); break; default: throw osmium::unknown_type{}; @@ -128,23 +128,23 @@ namespace osmium { inline void apply_item_impl(osmium::OSMEntity& item, THandler&& handler) { switch (item.type()) { case osmium::item_type::node: - handler.osm_object(static_cast(item)); - handler.node(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).node(static_cast(item)); break; case osmium::item_type::way: - handler.osm_object(static_cast(item)); - handler.way(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).way(static_cast(item)); break; case osmium::item_type::relation: - handler.osm_object(static_cast(item)); - handler.relation(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).relation(static_cast(item)); break; case osmium::item_type::area: - handler.osm_object(static_cast(item)); - handler.area(static_cast(item)); + std::forward(handler).osm_object(static_cast(item)); + std::forward(handler).area(static_cast(item)); break; case osmium::item_type::changeset: - handler.changeset(static_cast(item)); + std::forward(handler).changeset(static_cast(item)); break; default: throw osmium::unknown_type{}; @@ -155,20 +155,20 @@ namespace osmium { inline void apply_item_impl(const osmium::OSMObject& item, THandler&& handler) { switch (item.type()) { case osmium::item_type::node: - handler.osm_object(item); - handler.node(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).node(static_cast(item)); break; case osmium::item_type::way: - handler.osm_object(item); - handler.way(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).way(static_cast(item)); break; case osmium::item_type::relation: - handler.osm_object(item); - handler.relation(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).relation(static_cast(item)); break; case osmium::item_type::area: - handler.osm_object(item); - handler.area(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).area(static_cast(item)); break; default: throw osmium::unknown_type{}; @@ -179,20 +179,20 @@ namespace osmium { inline void apply_item_impl(osmium::OSMObject& item, THandler&& handler) { switch (item.type()) { case osmium::item_type::node: - handler.osm_object(item); - handler.node(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).node(static_cast(item)); break; case osmium::item_type::way: - handler.osm_object(item); - handler.way(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).way(static_cast(item)); break; case osmium::item_type::relation: - handler.osm_object(item); - handler.relation(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).relation(static_cast(item)); break; case osmium::item_type::area: - handler.osm_object(item); - handler.area(static_cast(item)); + std::forward(handler).osm_object(item); + std::forward(handler).area(static_cast(item)); break; default: throw osmium::unknown_type{};