From b091bc90bc7445fc117d5818ffd9b5314721fc4c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 30 May 2016 12:10:21 +0200 Subject: [PATCH] heap_allocator<> extended --- include/stdex/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/stdex/common.h b/include/stdex/common.h index c548a92c7..91832cb8e 100644 --- a/include/stdex/common.h +++ b/include/stdex/common.h @@ -155,6 +155,17 @@ namespace stdex HeapFree(m_heap, 0, ptr); } + /// + /// Calls copying constructor for the element + /// + /// \param[in] ptr Pointer to memory block + /// \param[in] val Source element + /// + inline void construct(_Inout_ pointer ptr, _In_ const _Ty& val) + { + ::new ((void*)ptr) _Ty(val); + } + /// /// Calls moving constructor for the element ///