diff --git a/include/stack_ptr.h b/include/stack_ptr.h index 1383127..a58f6fa 100644 --- a/include/stack_ptr.h +++ b/include/stack_ptr.h @@ -29,7 +29,8 @@ private: * Storage for the object * @var std::aligned_storage */ - std::aligned_storage _data; + typedef typename std::aligned_storage::type Type; + Type _data; /** * Is the pointer initialized? @@ -87,6 +88,7 @@ public: // initialize new object new (&_data) T(std::forward(parameters)...); + _initialized = true; } /**