// Copyright 2015 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef LIBCHROMEOS_CHROMEOS_MAKE_UNIQUE_PTR_H_ #define LIBCHROMEOS_CHROMEOS_MAKE_UNIQUE_PTR_H_ #include namespace chromeos { // A function to convert T* into unique_ptr // Doing e.g. make_unique_ptr(new FooBarBaz(arg)) is a shorter notation // for unique_ptr>(new FooBarBaz(arg)) // Basically the same as Chromium's make_scoped_ptr(). // Deliberately not named "make_unique" to avoid conflicting with the similar, // but more complex and semantically different C++14 function. template std::unique_ptr make_unique_ptr(T* ptr) { return std::unique_ptr(ptr); } } // namespace chromeos #endif // LIBCHROMEOS_CHROMEOS_MAKE_UNIQUE_PTR_H_