diff options
Diffstat (limited to 'libs/kstd/kstd/flat_map.hpp')
| -rw-r--r-- | libs/kstd/kstd/flat_map.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/kstd/kstd/flat_map.hpp b/libs/kstd/kstd/flat_map.hpp index b9b05366..3eda42d8 100644 --- a/libs/kstd/kstd/flat_map.hpp +++ b/libs/kstd/kstd/flat_map.hpp @@ -1,6 +1,7 @@ #ifndef KSTD_FLAT_MAP_HPP #define KSTD_FLAT_MAP_HPP +#include <kstd/bits/concepts.hpp> #include <kstd/os/error.hpp> #include <kstd/vector.hpp> @@ -912,10 +913,25 @@ namespace kstd template<typename KeyContainer, typename MappedContainer, typename Compare = std::less<typename KeyContainer::value_type>> + requires(!bits::allocator_like<Compare>) flat_map(KeyContainer, MappedContainer, Compare = Compare{}) -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type, Compare, KeyContainer, MappedContainer>; + template<typename KeyContainer, typename MappedContainer, typename Allocator> + requires(std::uses_allocator_v<KeyContainer, Allocator> && std::uses_allocator_v<MappedContainer, Allocator>) + flat_map(KeyContainer, MappedContainer, Allocator) + -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type, + std::less<typename KeyContainer::value_type>, // NOLINT(modernize-use-transparent-functors) + KeyContainer, MappedContainer>; + + template<typename KeyContainer, typename MappedContainer, typename Compare, typename Allocator> + requires(!bits::allocator_like<Compare> && std::uses_allocator_v<KeyContainer, Allocator> && + std::uses_allocator_v<MappedContainer, Allocator>) + flat_map(KeyContainer, MappedContainer, Compare, Allocator) + -> flat_map<typename KeyContainer::value_type, typename MappedContainer::value_type, Compare, KeyContainer, + MappedContainer>; + } // namespace kstd #endif
\ No newline at end of file |
