* added component traits (component.hpp) * support for in-place delete (tombstones)
30 lines
665 B
C++
30 lines
665 B
C++
#ifndef ENTT_ENTITY_COMPONENT_HPP
|
|
#define ENTT_ENTITY_COMPONENT_HPP
|
|
|
|
|
|
#include <type_traits>
|
|
#include "../config/config.h"
|
|
|
|
|
|
namespace entt {
|
|
|
|
|
|
/**
|
|
* @brief Common way to access various properties of components
|
|
* @tparam Type Type of component.
|
|
*/
|
|
template<typename Type, typename = void>
|
|
struct component_traits {
|
|
static_assert(std::is_same_v<std::decay_t<Type>, Type>, "Type is not decayed");
|
|
/*! @brief Pointer stable component, default is `std::false_type`. */
|
|
using in_place_delete = std::false_type;
|
|
/*! @brief Empty type optimization, default is `ENTT_IGNORE_IF_EMPTY`. */
|
|
using ignore_if_empty = ENTT_IGNORE_IF_EMPTY;
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|