26 #include "../../pmr/memory_resource.h"
27 #include "../../pmr/throw_bad_alloc.h"
32 template <
typename PromiseType >
48 void*
operator new( std::size_t
const sz,
auto&&... ) noexcept =
delete;
53 void*
const vp =
pi.allocate( sz,
alignof( PromiseType ) );
61 return static_cast< void*
>( p );
64 void operator delete(
void*
const ptr, std::size_t
const size )
71 static_cast< void*
>( p ), size +
ptr_size,
alignof( PromiseType ) );
72 if (
res == result::ERROR )
Definition: memory_resource.h:33
MIT License.
Definition: data_promise.h:27
void throw_bad_alloc()
Definition: throw_bad_alloc.h:32
constexpr angle pi
Constants of units that are relevant for us.
Definition: physical_quantity.h:134
T res
Definition: algorithm.h:505
Definition: memory_promise.h:34
static constexpr std::size_t ptr_size
Definition: memory_promise.h:35
static void * alloc(std::size_t sz, pmr::memory_resource &pi)
Definition: memory_promise.h:50
result represents an result of some operation, as an alternative to returning just bool with true/fal...
Definition: result.h:42