build fix
[LibreOffice.git] / include / o3tl / make_unique.hxx
blob2be03e9dc9cf3e6cad048cebfb1c613fb0ccc610
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_O3TL_MAKE_UNIQUE_HXX
11 #define INCLUDED_O3TL_MAKE_UNIQUE_HXX
13 #include <memory>
14 #include <utility>
16 namespace o3tl
19 /**
20 * Constructs an object of type T and wraps it in a std::unique_ptr.
22 * Can be replaced by std::make_unique when we allow C++14.
24 template<typename T, typename... Args>
25 typename std::unique_ptr<T> make_unique(Args&& ... args)
27 return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
32 #endif
34 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */