Struct basic_associative_container
Synopsis
#include <src/entt/meta/container.hpp>
template<typename Container>
struct basic_associative_container
Description
Basic STL-compatible associative container traits.
- Template Parameters
Container
- The type of the container.
Methods
cfind | Returns an iterator to the element with key equivalent to the given one, if any. | |
find | Returns an iterator to the element with key equivalent to the given one, if any. |
Source
Lines 96-116 in src/entt/meta/container.hpp.
template<typename Container>
struct basic_associative_container {
/*! @brief Key type of the sequence container. */
using key_type = typename Container::key_type;
/**
* @brief Returns an iterator to the element with key equivalent to the
* given one, if any.
* @param cont The container in which to search for the element.
* @param key The key of the element to search.
* @return An iterator to the element with the given key, if any.
*/
[[nodiscard]] static typename Container::iterator find(Container &cont, const key_type &key) {
return cont.find(key);
}
/*! @copydoc find */
[[nodiscard]] static typename Container::const_iterator cfind(const Container &cont, const key_type &key) {
return cont.find(key);
}
};