meta: allow for a smoother transition before dropping meta_associative_container::key_only

This commit is contained in:
Michele Caini
2023-08-19 16:22:59 +02:00
parent 45d4bd0cf5
commit c9a5fda400
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -119,6 +119,7 @@ public:
storage = forward_as_any(instance);
}
[[nodiscard]] inline bool key_only() const noexcept;
[[nodiscard]] inline meta_type key_type() const noexcept;
[[nodiscard]] inline meta_type mapped_type() const noexcept;
[[nodiscard]] inline meta_type value_type() const noexcept;
@@ -1861,6 +1862,14 @@ inline meta_sequence_container::iterator meta_sequence_container::erase(iterator
return static_cast<bool>(storage);
}
/**
* @brief Returns true if a container is also key-only, false otherwise.
* @return True if the associative container is also key-only, false otherwise.
*/
[[nodiscard]] inline bool meta_associative_container::key_only() const noexcept {
return (mapped_type_node == nullptr);
}
/**
* @brief Returns the meta key type of a container.
* @return The meta key type of the a container.