12 template<ice::concepts::AssociativeContainer Self, ice::concepts::HashableKeyType KeyType>
13 bool has(
this Self
const& self,
KeyType const& key)
noexcept
15 return self.find(
ice::hash(key)) !=
nullptr;
18 template<ice::concepts::AssociativeContainer Self, ice::concepts::HashableKeyType KeyType>
21 return self.find(
ice::hash(key)) ==
nullptr;
27 typename InValueType =
typename std::remove_reference_t<Self>::ValueType
30 this Self
const& self,
32 InValueType
const& fallback_value
38 return result !=
nullptr ? *result : fallback_value;
59 typename InValueType =
typename std::remove_reference_t<Self>::ValueType
61 requires(std::convertible_to<InValueType, typename Self::ValueType>)
65 InValueType&& in_value
68 return self.store(
ice::hash(key), std::forward<InValueType>(in_value));
74 typename InValueType =
typename std::remove_reference_t<Self>::ValueType
76 requires(std::convertible_to<InValueType, typename Self::ValueType>)
80 InValueType&& in_value
84 if (self.missing(key_hash))
86 self.set(key_hash, std::forward<InValueType>(in_value));
93 typename InValueType =
typename std::remove_reference_t<Self>::ValueType
98 InValueType&& in_value
102 if (self.missing(key_hash))
104 return self.set(key_hash, std::forward<InValueType>(in_value));
#define ICE_ASSERT_CORE(expression)
Definition assert_core.hxx:43
Definition container_concepts.hxx:33
Definition container_concepts.hxx:47
Definition container_concepts.hxx:83
Definition associative_container.hxx:8
ValueType< ContainerT > * ValuePtr
Definition container_concepts.hxx:155
typename std::remove_reference_t< ContainerT >::KeyType KeyType
Definition container_concepts.hxx:135
ValueType< ContainerT > & ValueRef
Definition container_concepts.hxx:149
std::uint64_t u64
Definition types.hxx:27
constexpr auto hash(ice::HeapString<> const &value) noexcept -> ice::u64
Definition heap_string.hxx:251
Definition associative_container.hxx:11
auto get(this Self const &self, KeyType const &key, InValueType const &fallback_value) noexcept -> ice::container::ValueRef< Self const >
Definition associative_container.hxx:29
auto try_get(this Self &&self, KeyType const &key) noexcept -> ice::container::ValuePtr< Self >
Definition associative_container.hxx:44
bool has(this Self const &self, KeyType const &key) noexcept
Definition associative_container.hxx:13
bool missing(this Self const &self, KeyType const &key) noexcept
Definition associative_container.hxx:19
Definition associative_container.hxx:55
bool remove(this Self &&self, KeyType const &key) noexcept
Definition associative_container.hxx:117
auto set(this Self &self, KeyType const &key, InValueType &&in_value) noexcept -> ice::container::ValueRef< Self >
Definition associative_container.hxx:62
auto get_or_set(this Self &&self, KeyType const &key, InValueType &&in_value) noexcept -> ice::container::ValueRef< Self >
Definition associative_container.hxx:95
void set_if_missing(this Self &self, KeyType const &key, InValueType &&in_value) noexcept
Definition associative_container.hxx:77
Definition basic_container.hxx:11