Smart pointers with value semantics supporting polymorphic deep copies. More...
Classes | |
struct | aurora::OperatorNewCopy< T > |
Cloner that invokes the copy constructor and new operator. More... | |
struct | aurora::VirtualClone< T > |
Cloner that invokes a member function clone(). More... | |
struct | aurora::OperatorDelete< T > |
Deleter that invokes the delete operator. More... | |
class | aurora::CopiedPtr< T > |
Copyable smart pointer template. More... | |
Functions | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | aurora::makeUnique (Args &&...args) |
Emplaces an object directly inside the unique pointer. More... | |
template<typename T > | |
void | swap (CopiedPtr< T > &lhs, CopiedPtr< T > &rhs) |
Swaps the contents of two CopiedPtr instances. | |
template<typename T , typename... Args> | |
CopiedPtr< T > | makeCopied (Args &&...args) |
Emplaces an object directly inside the copied pointer. More... | |
Smart pointers with value semantics supporting polymorphic deep copies.
|
related |
Emplaces an object directly inside the copied pointer.
args | Variable argument list, the single arguments are forwarded to T's constructor. If your compiler does not support variadic templates, the number of arguments must be smaller than AURORA_PP_LIMIT. |
This function has several advantages over the regular CopiedPtr(U*) constructor:
Example:
std::unique_ptr<T> aurora::makeUnique | ( | Args &&... | args | ) |
Emplaces an object directly inside the unique pointer.
args | Variable argument list, the single arguments are forwarded to T's constructor. If your compiler does not support variadic templates, the number of arguments must be smaller than AURORA_PP_LIMIT. |
Does the same as std::make_unique() in C++14. Example: