diff options
| author | 2014-12-20 03:21:23 -0200 | |
|---|---|---|
| committer | 2014-12-20 03:45:02 -0200 | |
| commit | 82528ba7df7bb8b2a6d89c416a66aee5c39f7f66 (patch) | |
| tree | 98e535bae4b71d89614a0e75b7d83b4de0fa1c5b /src/common/make_unique.h | |
| parent | Merge pull request #306 from Subv/even_more_savedata (diff) | |
| download | yuzu-82528ba7df7bb8b2a6d89c416a66aee5c39f7f66.tar.gz yuzu-82528ba7df7bb8b2a6d89c416a66aee5c39f7f66.tar.xz yuzu-82528ba7df7bb8b2a6d89c416a66aee5c39f7f66.zip | |
Common: Add a clone of std::make_unique
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 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | |||
| 9 | namespace Common { | ||
| 10 | |||
| 11 | template <typename T, typename... Args> | ||
| 12 | std::unique_ptr<T> make_unique(Args&&... args) { | ||
| 13 | return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); | ||
| 14 | } | ||
| 15 | |||
| 16 | } // namespace | ||