From 9119de3a643f8adf2c4a12587e32577caa762b5a Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Fri, 12 Aug 2022 16:10:21 +0200 Subject: Fix build with gcc/g++ --- .../build_engine/expression/linked_map.hpp | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/buildtool/build_engine/expression/linked_map.hpp') diff --git a/src/buildtool/build_engine/expression/linked_map.hpp b/src/buildtool/build_engine/expression/linked_map.hpp index 59361dcf..2df8982b 100644 --- a/src/buildtool/build_engine/expression/linked_map.hpp +++ b/src/buildtool/build_engine/expression/linked_map.hpp @@ -35,7 +35,7 @@ class LinkedMapPtr { [[nodiscard]] auto IsNotNull() const noexcept -> bool { return static_cast(ptr_); } - [[nodiscard]] auto LinkedMap() const& -> map_t const& { return *ptr_; } + [[nodiscard]] auto Map() const& -> map_t const& { return *ptr_; } [[nodiscard]] static auto Make(map_t&& map) -> ptr_t { return ptr_t{std::make_shared(std::move(map))}; } @@ -143,15 +143,15 @@ class LinkedMap { } [[nodiscard]] auto empty() const noexcept -> bool { - return (content_.IsNotNull() ? content_.LinkedMap().empty() + return (content_.IsNotNull() ? content_.Map().empty() : map_.empty()) and - (not next_.IsNotNull() or next_.LinkedMap().empty()); + (not next_.IsNotNull() or next_.Map().empty()); } [[nodiscard]] auto Find(K const& key) const& noexcept -> std::optional> { if (content_.IsNotNull()) { - auto val = content_.LinkedMap().Find(key); + auto val = content_.Map().Find(key); if (val) { return val; } @@ -163,7 +163,7 @@ class LinkedMap { } } if (next_.IsNotNull()) { - auto val = next_.LinkedMap().Find(key); + auto val = next_.Map().Find(key); if (val) { return val; } @@ -173,7 +173,7 @@ class LinkedMap { [[nodiscard]] auto Find(K const& key) && noexcept -> std::optional { if (content_.IsNotNull()) { - auto val = content_.LinkedMap().Find(key); + auto val = content_.Map().Find(key); if (val) { return val->get(); } @@ -185,7 +185,7 @@ class LinkedMap { } } if (next_.IsNotNull()) { - auto val = next_.LinkedMap().Find(key); + auto val = next_.Map().Find(key); if (val) { return val->get(); } @@ -294,10 +294,9 @@ class LinkedMap { AtomicValue items_{}; [[nodiscard]] auto ComputeSortedItems() const noexcept -> items_t { - auto size = - content_.IsNotNull() ? content_.LinkedMap().size() : map_.size(); + auto size = content_.IsNotNull() ? content_.Map().size() : map_.size(); if (next_.IsNotNull()) { - size += next_.LinkedMap().size(); + size += next_.Map().size(); } auto items = items_t{}; @@ -311,7 +310,7 @@ class LinkedMap { typename items_t::const_iterator nitemsend; if (content_.IsNotNull()) { - auto const& citems = content_.LinkedMap().Items(); + auto const& citems = content_.Map().Items(); citemsit = citems.begin(); citemsend = citems.end(); } @@ -322,7 +321,7 @@ class LinkedMap { citemsend = map_copy.end(); } if (next_.IsNotNull()) { - auto const& nitems = next_.LinkedMap().Items(); + auto const& nitems = next_.Map().Items(); nitemsit = nitems.begin(); nitemsend = nitems.end(); } -- cgit v1.2.3