7#if !defined(ASYNC_MQTT_UTIL_SHARED_PTR_ARRAY_HPP)
8#define ASYNC_MQTT_UTIL_SHARED_PTR_ARRAY_HPP
26#if __cpp_lib_shared_ptr_arrays >= 201707L
27 return std::make_shared<char[]>(size);
29 return std::shared_ptr<char[]>(
new char[size]);
45template <
typename Alloc>
47#if __cpp_lib_shared_ptr_arrays >= 201707L
48 return std::allocate_shared<char[]>(alloc, size);
50 return std::shared_ptr<char[]>(
52 [alloc, size](
char* ptr)
mutable { alloc.deallocate(ptr, size); }
std::shared_ptr< char[]> allocate_shared_ptr_char_array(Alloc &&alloc, std::size_t size)
shared_ptr<char[]> creating function with allocator. You can choose the target type.
Definition shared_ptr_array.hpp:46
std::shared_ptr< char[]> make_shared_ptr_char_array(std::size_t size)
shared_ptr<char[]> creating function. You can choose the target type.
Definition shared_ptr_array.hpp:25