@@ -100,24 +100,24 @@ struct NBL_API AlignedWithAllocator
100100
101101// use these by default instead of new and delete, single object (non-array) new takes constructor parameters as va_args
102102#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)
104104
105105#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)
107107
108108// ! Extra Utility Macros for when you don't want to always have to deduce the alignment but want to use a specific allocator
109109// #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!")
110110#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!" )
111111
112112#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__); \
113113 _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))
116116
117117#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); \
118118 _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))
121121
122122
123123namespace nbl
0 commit comments