Elements  6.2
A C++ base framework for the Euclid Software.
Memory.h
Go to the documentation of this file.
1 
34 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_MEMORY_H_
35 #define ELEMENTSKERNEL_ELEMENTSKERNEL_MEMORY_H_
36 
37 #include <memory> // for unique_ptr, make_unique
38 
39 #include "ElementsKernel/Export.h" // ELEMENTS_API
40 
41 namespace Elements {
42 inline namespace Kernel {
43 
44 #ifndef __cpp_lib_make_unique
45 
54 template <typename T, typename... Args>
56  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
57 }
58 #else
59 using std::make_unique;
60 #endif
61 
62 } // namespace Kernel
63 } // namespace Elements
64 
65 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_MEMORY_H_
66 
Export.h
defines the macros to be used for explicit export of the symbols
ELEMENTS_API
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::Kernel::make_unique
ELEMENTS_API std::unique_ptr< T > make_unique(Args &&... args)
Constructs an object of type T and wraps it in a std::unique_ptr using args as the parameter list for...
Definition: Memory.h:55
std::unique_ptr
STL class.
Elements
Definition: callBackExample.h:35