@@ -100,24 +100,24 @@ struct NBL_API AlignedWithAllocator
100
100
101
101
// use these by default instead of new and delete, single object (non-array) new takes constructor parameters as va_args
102
102
#define _NBL_NEW (_obj_type, ... ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::VA_ARGS_comma_workaround(_NBL_DEFAULT_ALIGNMENT(_obj_type)).new_(__VA_ARGS__)
103
- #define _NBL_DELETE (_obj ) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type ,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type > >::delete_(_obj)
103
+ #define _NBL_DELETE (_obj ) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> ,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> > >::delete_(_obj)
104
104
105
105
#define _NBL_NEW_ARRAY (_obj_type,count ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::new_array(count,_NBL_DEFAULT_ALIGNMENT(_obj_type))
106
- #define _NBL_DELETE_ARRAY (_obj,count ) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference_t <typename std::remove_pointer_t <decltype (_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference_t <typename std::remove_pointer_t <decltype (_obj)>>> >::delete_array(_obj,count)
106
+ #define _NBL_DELETE_ARRAY (_obj,count ) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t <std::remove_pointer_t <decltype (_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t <std::remove_pointer_t <decltype (_obj)>>> >::delete_array(_obj,count)
107
107
108
108
// ! Extra Utility Macros for when you don't want to always have to deduce the alignment but want to use a specific allocator
109
109
// #define _NBL_ASSERT_ALLOCATOR_VALUE_TYPE(_obj_type,_allocator_type) static_assert(std::is_same<_obj_type,_allocator_type::value_type>::value,"Wrong allocator value_type!")
110
110
#define _NBL_ASSERT_ALLOCATOR_VALUE_TYPE (_obj_type,_allocator_type ) static_assert (std::is_same<_obj_type,std::allocator_traits<_allocator_type >::value_type>::value," Wrong allocator value_type!" )
111
111
112
112
#define _NBL_NEW_W_ALLOCATOR (_obj_type,_allocator, ... ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::VA_ARGS_comma_workaround(_NBL_DEFAULT_ALIGNMENT(_obj_type),_allocator).new_(__VA_ARGS__); \
113
113
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE (_obj_type,decltype (_allocator))
114
- #define _NBL_DELETE_W_ALLOCATOR (_obj,_allocator ) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type ,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type > >::delete_(_obj,_allocator); \
115
- _NBL_ASSERT_ALLOCATOR_VALUE_TYPE (std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type ,decltype(_allocator))
114
+ #define _NBL_DELETE_W_ALLOCATOR (_obj,_allocator ) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> ,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> > >::delete_(_obj,_allocator); \
115
+ _NBL_ASSERT_ALLOCATOR_VALUE_TYPE (std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> ,decltype(_allocator))
116
116
117
117
#define _NBL_NEW_ARRAY_W_ALLOCATOR (_obj_type,count,_allocator ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::new_array(count,_NBL_DEFAULT_ALIGNMENT(_obj_type),_allocator); \
118
118
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE (_obj_type,decltype (_allocator))
119
- #define _NBL_DELETE_ARRAY_W_ALLOCATOR (_obj,count,_allocator ) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type ,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type > >::delete_array(_obj,count,_allocator); \
120
- _NBL_ASSERT_ALLOCATOR_VALUE_TYPE (std::remove_reference< typename std::remove_pointer <decltype (_obj)>::type>::type ,decltype(_allocator))
119
+ #define _NBL_DELETE_ARRAY_W_ALLOCATOR (_obj,count,_allocator ) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> ,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> > >::delete_array(_obj,count,_allocator); \
120
+ _NBL_ASSERT_ALLOCATOR_VALUE_TYPE (std::remove_reference_t < std::remove_pointer_t <decltype (_obj)>> ,decltype(_allocator))
121
121
122
122
123
123
namespace nbl
0 commit comments