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 ///