Line data Source code
1 : /*
2 : * Copyright 2016 Google Inc.
3 : *
4 : * Use of this source code is governed by a BSD-style license that can be
5 : * found in the LICENSE file.
6 : */
7 :
8 : #ifndef SkMakeUnique_DEFINED
9 : #define SkMakeUnique_DEFINED
10 :
11 : #include <memory>
12 :
13 : namespace skstd {
14 :
15 : // std::make_unique is in C++14
16 : template<typename T, typename... Args>
17 0 : std::unique_ptr<T> make_unique(Args&&... args) {
18 0 : return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
19 : }
20 :
21 : }
22 :
23 : #endif // SkMakeUnique_DEFINED
|