Struct basic_dynamic_associative_container

Synopsis

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

template<typename Container>
struct basic_dynamic_associative_container

Description

Basic STL-compatible dynamic associative container traits.

Template Parameters

Container - The type of the container.

Methods

eraseRemoves the specified element from the given container.

Source

Lines 113-125 in src/entt/meta/container.hpp.

template<typename Container>
struct basic_dynamic_associative_container {
    /**
     * @brief Removes the specified element from the given container.
     * @param cont The container from which to remove the element.
     * @param key The element to remove.
     * @return A bool denoting whether the removal took place.
     */
    [[nodiscard]] static bool erase(Container &cont, const typename Container::key_type &key) {
        const auto sz = cont.size();
        return cont.erase(key) != sz;
    }
};





Add Discussion

Log in to comment