HeterogeneousContainers: Drop pre-C++20 path

This commit is contained in:
Stenzek 2023-07-19 23:59:22 +10:00 committed by Connor McLaughlin
parent 1fae35231b
commit 7676a74f73
1 changed files with 0 additions and 43 deletions

View File

@ -60,8 +60,6 @@ namespace detail
};
} // namespace detail
// This requires C++20, so fallback to ugly heap allocations if we don't have it.
#if __cplusplus >= 202002L
template <typename ValueType>
using UnorderedStringMap =
std::unordered_map<std::string, ValueType, detail::transparent_string_hash, detail::transparent_string_equal>;
@ -109,47 +107,6 @@ UnorderedStringMultiMapEqualRange(UnorderedStringMultimap<ValueType>& map, const
{
return map.equal_range(key);
}
#else
template <typename ValueType>
using UnorderedStringMap = std::unordered_map<std::string, ValueType>;
template <typename ValueType>
using UnorderedStringMultimap = std::unordered_multimap<std::string, ValueType>;
using UnorderedStringSet = std::unordered_set<std::string>;
using UnorderedStringMultiSet = std::unordered_multiset<std::string>;
template <typename KeyType, typename ValueType>
__fi typename UnorderedStringMap<ValueType>::const_iterator UnorderedStringMapFind(const UnorderedStringMap<ValueType>& map, const KeyType& key)
{
return map.find(std::string(key));
}
template <typename KeyType, typename ValueType>
__fi typename UnorderedStringMap<ValueType>::iterator UnorderedStringMapFind(UnorderedStringMap<ValueType>& map, const KeyType& key)
{
return map.find(std::string(key));
}
template <typename KeyType, typename ValueType>
__fi typename UnorderedStringMultimap<ValueType>::const_iterator UnorderedStringMultiMapFind(const UnorderedStringMultimap<ValueType>& map, const KeyType& key)
{
return map.find(std::string(key));
}
template <typename KeyType, typename ValueType>
__fi std::pair<typename UnorderedStringMultimap<ValueType>::const_iterator, typename UnorderedStringMultimap<ValueType>::const_iterator>
UnorderedStringMultiMapEqualRange(const UnorderedStringMultimap<ValueType>& map, const KeyType& key)
{
return map.equal_range(std::string(key));
}
template <typename KeyType, typename ValueType>
__fi typename UnorderedStringMultimap<ValueType>::iterator UnorderedStringMultiMapFind(UnorderedStringMultimap<ValueType>& map, const KeyType& key)
{
return map.find(std::string(key));
}
template <typename KeyType, typename ValueType>
__fi std::pair<typename UnorderedStringMultimap<ValueType>::iterator, typename UnorderedStringMultimap<ValueType>::iterator>
UnorderedStringMultiMapEqualRange(UnorderedStringMultimap<ValueType>& map, const KeyType& key)
{
return map.equal_range(std::string(key));
}
#endif
template <typename ValueType>
using StringMap = std::map<std::string, ValueType, detail::transparent_string_less>;