From 7f74d35955fae9cb13e4addcd9a4f67f48b4b6fe Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 22 Nov 2017 01:46:54 +0100 Subject: [PATCH] Workaround MSVC inlining bugs. The previous code was not inlineable. --- server/tracy_flat_hash_map.hpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/server/tracy_flat_hash_map.hpp b/server/tracy_flat_hash_map.hpp index d65b5fb6..84aee040 100644 --- a/server/tracy_flat_hash_map.hpp +++ b/server/tracy_flat_hash_map.hpp @@ -508,7 +508,7 @@ public: operator templated_iterator() const { - return { current }; + return templated_iterator { current }; } }; using iterator = templated_iterator; @@ -519,7 +519,7 @@ public: for (EntryPointer it = entries;; ++it) { if (it->has_value()) - return { it }; + return iterator { it }; } } const_iterator begin() const @@ -527,7 +527,7 @@ public: for (EntryPointer it = entries;; ++it) { if (it->has_value()) - return { it }; + return const_iterator { it }; } } const_iterator cbegin() const @@ -536,11 +536,11 @@ public: } iterator end() { - return { entries + static_cast(num_slots_minus_one + max_lookups) }; + return iterator { entries + static_cast(num_slots_minus_one + max_lookups) }; } const_iterator end() const { - return { entries + static_cast(num_slots_minus_one + max_lookups) }; + return const_iterator { entries + static_cast(num_slots_minus_one + max_lookups) }; } const_iterator cend() const { @@ -554,7 +554,7 @@ public: for (int8_t distance = 0; it->distance_from_desired >= distance; ++distance, ++it) { if (compares_equal(key, it->value)) - return { it }; + return iterator { it }; } return end(); } @@ -570,17 +570,17 @@ public: { iterator found = find(key); if (found == end()) - return { found, found }; + return std::pair { found, found }; else - return { found, std::next(found) }; + return std::pair { found, std::next(found) }; } std::pair equal_range(const FindKey & key) const { const_iterator found = find(key); if (found == end()) - return { found, found }; + return std::pair { found, found }; else - return { found, std::next(found) }; + return std::pair { found, std::next(found) }; } template @@ -592,7 +592,7 @@ public: for (; current_entry->distance_from_desired >= distance_from_desired; ++current_entry, ++distance_from_desired) { if (compares_equal(key, current_entry->value)) - return { { current_entry }, false }; + return std::pair { iterator { current_entry }, false }; } return emplace_new_key(distance_from_desired, current_entry, std::forward(key), std::forward(args)...); } @@ -689,7 +689,7 @@ public: current->emplace(next->distance_from_desired - 1, std::move(next->value)); next->destroy_value(); } - return { to_erase.current }; + return convertible_to_iterator { to_erase.current }; } iterator erase(const_iterator begin_it, const_iterator end_it) @@ -714,7 +714,7 @@ public: ++it; num_to_move = std::min(static_cast(it->distance_from_desired), num_to_move); } - return { to_return }; + return iterator { to_return }; } size_t erase(const FindKey & key) @@ -922,14 +922,14 @@ private: operator iterator() { if (it->has_value()) - return { it }; + return convertible_to_iterator { it }; else return ++iterator{it}; } operator const_iterator() { if (it->has_value()) - return { it }; + return convertible_to_iterator { it }; else return ++const_iterator{it}; }