32 lines
861 B
C++
32 lines
861 B
C++
#pragma once
|
|
#define EVERGREEN_OBJECT_INSTANCE(type_name, allocator, ...) \
|
|
memories::instance_object<type_name>(allocator, __VA_ARGS__)
|
|
|
|
#define MORTAL_OBJECT_INSTANCE(type_name, left_value , allocator, ...) \
|
|
left_value = std::pmr::polymorphic_allocator<type_name>(allocator).allocate(sizeof(type_name));\
|
|
new(left_value) type_name(__VA_ARGS__)
|
|
|
|
|
|
|
|
#define DISALLOW_COPY(type_name) \
|
|
type_name(const type_name&) = delete
|
|
|
|
|
|
#define DISALLOW_ASSIGN(type_name) type_name& operator=(const type_name&) = delete
|
|
|
|
|
|
#define DISALLOW_COPY_AND_ASSIGN(type_name) \
|
|
DISALLOW_COPY(type_name); \
|
|
DISALLOW_ASSIGN(type_name)
|
|
|
|
#define DISALLOW_IMPLICIT_DESTRUCTOR(type_name) \
|
|
~type_name() = delete;
|
|
|
|
|
|
#define DISALLOW_IMPLICIT_CONSTRUCTORS(type_name) \
|
|
type_name() = delete; \
|
|
DISALLOW_COPY_AND_ASSIGN(type_name)
|
|
|
|
|
|
|