Struct basic_container
Synopsis
#include <src/entt/meta/container.hpp>
template<typename Container>
struct basic_container
Description
Basic STL-compatible container traits.
- Template Parameters
Container
- The type of the container.
Methods
begin | Returns an iterator to the first element of the given container. | |
cbegin | Returns an iterator to the first element of the given container. | |
cend | Returns an iterator past the last element of the given container. | |
end | Returns an iterator past the last element of the given container. | |
size | Returns the size of the given container. |
Source
Lines 34-89 in src/entt/meta/container.hpp.
template<typename Container>
struct basic_container {
/*! @brief Iterator type of the container. */
using iterator = typename Container::iterator;
/*! @brief Iterator type of the container. */
using const_iterator = typename Container::const_iterator;
/*! @brief Unsigned integer type. */
using size_type = typename Container::size_type;
/*! @brief Value type of the container. */
using value_type = typename Container::value_type;
/**
* @brief Returns the size of the given container.
* @param cont The container for which to return the size.
* @return The size of the given container.
*/
[[nodiscard]] static size_type size(const Container &cont) ENTT_NOEXCEPT {
return cont.size();
}
/**
* @brief Returns an iterator to the first element of the given container.
* @param cont The container for which to return the iterator.
* @return An iterator to the first element of the given container.
*/
[[nodiscard]] static iterator begin(Container &cont) {
return cont.begin();
}
/**
* @brief Returns an iterator to the first element of the given container.
* @param cont The container for which to return the iterator.
* @return An iterator to the first element of the given container.
*/
[[nodiscard]] static const_iterator cbegin(const Container &cont) {
return cont.begin();
}
/**
* @brief Returns an iterator past the last element of the given container.
* @param cont The container for which to return the iterator.
* @return An iterator past the last element of the given container.
*/
[[nodiscard]] static iterator end(Container &cont) {
return cont.end();
}
/**
* @brief Returns an iterator past the last element of the given container.
* @param cont The container for which to return the iterator.
* @return An iterator past the last element of the given container.
*/
[[nodiscard]] static const_iterator cend(const Container &cont) {
return cont.end();
}
};