19#define FLECS_PLACEMENT_NEW(_ptr, _type) ::new(flecs::_::placement_new_tag, _ptr) _type
20#define FLECS_NEW(_type) FLECS_PLACEMENT_NEW(ecs_os_malloc(sizeof(_type)), _type)
21#define FLECS_DELETE(_ptr) \
24 flecs::_::destruct_obj(_ptr); \
33#define FLECS_MOV(...) \
34 static_cast<flecs::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__)
36#define FLECS_FWD(...) \
37 static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__)
48template<
class Ty>
inline void destruct_obj(Ty* _ptr) { _ptr->~Ty(); }
49template<
class Ty>
inline void free_obj(
void* _ptr) {
51 destruct_obj(
static_cast<Ty*
>(_ptr));
61#ifndef flecs_static_assert
62#define flecs_static_assert(cond, str) static_assert(cond, str)
75 template <
typename T,
typename F>
using type = F;
79 template <
typename T,
typename F>
using type = T;
82using std::conditional_t;
84using std::enable_if_t;
85using std::remove_pointer_t;
86using std::remove_reference_t;
87using std::underlying_type_t;
92using std::is_reference;
93using std::is_volatile;
96using std::is_trivially_constructible;
97using std::is_trivially_move_assignable;
98using std::is_trivially_copy_assignable;
99using std::is_trivially_copy_constructible;
100using std::is_trivially_move_constructible;
101using std::is_trivially_copyable;
102using std::is_move_assignable;
103using std::is_move_constructible;
104using std::is_copy_constructible;
105using std::is_trivially_destructible;
106using std::is_empty_v;
107using std::is_const_v;
108using std::is_pointer_v;
109using std::is_reference_v;
110using std::is_volatile_v;
113using std::is_base_of_v;
114using std::is_trivially_constructible_v;
115using std::is_trivially_destructible_v;
116using std::is_trivially_copyable_v;
117using std::is_trivially_move_constructible_v;
118using std::is_trivially_copy_constructible_v;
119using std::is_trivially_move_assignable_v;
120using std::is_trivially_copy_assignable_v;
121using std::is_default_constructible_v;
122using std::is_move_constructible_v;
123using std::is_copy_constructible_v;
124using std::is_move_assignable_v;
125using std::is_copy_assignable_v;
126using std::is_destructible_v;
130using is_const_p = is_const< remove_pointer_t<T> >;
134template<
class Src,
class Dst>
135using transcribe_const_t = conditional_t<is_const<Src>::value, Dst
const, Dst>;
137template<
class Src,
class Dst>
138using transcribe_volatile_t = conditional_t<is_volatile<Src>::value, Dst
volatile, Dst>;
140template<
class Src,
class Dst>
141using transcribe_cv_t = transcribe_const_t< Src, transcribe_volatile_t< Src, Dst> >;
143template<
class Src,
class Dst>
144using transcribe_pointer_t = conditional_t<is_pointer<Src>::value, Dst*, Dst>;
146template<
class Src,
class Dst>
147using transcribe_cvp_t = transcribe_cv_t< Src, transcribe_pointer_t< Src, Dst> >;
159using if_t = enable_if_t<V, int>;
162using if_not_t = enable_if_t<false == V, int>;
170 static const bool value =
false;
Compile time enum reflection utilities.
Compile time utilities to inspect properties of functions.
String utility that doesn't implicitly allocate memory.
Wrapper around ecs_strbuf_t that provides a simple stringstream like API.