Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: src/core/SkMakeUnique.h

Issue 2293963002: SkMakeUnique.h defines skstd::make_unique<T>(Args...) (Closed)
Patch Set: move to src/core Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pdf/SkDeflate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMakeUnique.h
diff --git a/src/core/SkMakeUnique.h b/src/core/SkMakeUnique.h
new file mode 100644
index 0000000000000000000000000000000000000000..188eb05ff4c410d8297a08d3a3ad25a5a6c5270f
--- /dev/null
+++ b/src/core/SkMakeUnique.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkMakeUnique_DEFINED
+#define SkMakeUnique_DEFINED
+
+#include <memory>
+
+namespace skstd {
+
+// std::make_unique is in C++14
+template<typename T, typename... Args>
+std::unique_ptr<T> make_unique(Args&&... args) {
+ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+
+}
+
+#endif // SkMakeUnique_DEFINED
« no previous file with comments | « no previous file | src/pdf/SkDeflate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698