diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2017-11-22 03:46:54 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2017-11-22 03:54:50 +0300 |
commit | 7f74d35955fae9cb13e4addcd9a4f67f48b4b6fe (patch) | |
tree | 1b2db54da512eda0ab26fa6aeb2aa80afddcf948 /server/tracy_flat_hash_map.hpp | |
parent | 5d7fd5805a0d3e8b38e917251ea5c725dfc79292 (diff) |
Workaround MSVC inlining bugs.
The previous code was not inlineable.
Diffstat (limited to 'server/tracy_flat_hash_map.hpp')
-rw-r--r-- | server/tracy_flat_hash_map.hpp | 30 |
1 files 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 value_type>() const { - return { current }; + return templated_iterator<const value_type> { current }; } }; using iterator = templated_iterator<value_type>; @@ -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<ptrdiff_t>(num_slots_minus_one + max_lookups) }; + return iterator { entries + static_cast<ptrdiff_t>(num_slots_minus_one + max_lookups) }; } const_iterator end() const { - return { entries + static_cast<ptrdiff_t>(num_slots_minus_one + max_lookups) }; + return const_iterator { entries + static_cast<ptrdiff_t>(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<iterator, iterator> { found, found }; else - return { found, std::next(found) }; + return std::pair<iterator, iterator> { found, std::next(found) }; } std::pair<const_iterator, const_iterator> equal_range(const FindKey & key) const { const_iterator found = find(key); if (found == end()) - return { found, found }; + return std::pair<const_iterator, const_iterator> { found, found }; else - return { found, std::next(found) }; + return std::pair<const_iterator, const_iterator> { found, std::next(found) }; } template<typename Key, typename... Args> @@ -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, bool> { iterator { current_entry }, false }; } return emplace_new_key(distance_from_desired, current_entry, std::forward<Key>(key), std::forward<Args>(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<ptrdiff_t>(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}; } |