Struct dynamic_associative_key_value_container

Synopsis

#include <src/entt/meta/container.hpp>

template<typename Container>
struct dynamic_associative_key_value_container

Description

STL-compatible dynamic key-value associative container traits.

Template Parameters

Container - The type of the container.

Methods

insertInserts an element (a key/value pair) into the given container.

Source

Lines 169-181 in src/entt/meta/container.hpp.

template<typename Container>
struct dynamic_associative_key_value_container {
    /**
     * @brief Inserts an element (a key/value pair) into the given container.
     * @param cont The container in which to insert the element.
     * @param key The key of the element to insert.
     * @param value The value of the element to insert.
     * @return A bool denoting whether the insertion took place.
     */
    [[nodiscard]] static bool insert(Container &cont, const typename Container::key_type &key, const typename Container::mapped_type &value) {
        return cont.insert(std::make_pair(key, value)).second;
    }
};





Add Discussion

Log in to comment