/* * 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 namespace skstd { // std::make_unique is in C++14 template std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } template std::unique_ptr make_unique_default(size_t n) { return std::unique_ptr(new typename std::remove_extent::type[n]); } } #endif // SkMakeUnique_DEFINED