diff options
| author | Tony Wasserka <neobrainx@gmail.com> | 2014-12-20 15:07:47 +0100 |
|---|---|---|
| committer | Tony Wasserka <neobrainx@gmail.com> | 2014-12-20 15:07:47 +0100 |
| commit | c2753d37a743e48548a6c792a0ec2278591f79a0 (patch) | |
| tree | f456dd3613a1916f492b58013be929b7983b29c5 /src/common/make_unique.h | |
| parent | f1309e6bf0d29cc0f71f9864ea7e2c1dc62eb23b (diff) | |
| parent | 98a9aba46f1b1d3705f9387f028277fd0e5ba98d (diff) | |
Merge pull request #317 from yuriks/make_unique
Add a clone of std::make_unique and revert C++14 requirement
Diffstat (limited to 'src/common/make_unique.h')
| -rw-r--r-- | src/common/make_unique.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/make_unique.h b/src/common/make_unique.h new file mode 100644 index 000000000..2a7b76412 --- /dev/null +++ b/src/common/make_unique.h @@ -0,0 +1,16 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> + +namespace Common { + +template <typename T, typename... Args> +std::unique_ptr<T> make_unique(Args&&... args) { + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + +} // namespace |
