From 97d68765d24c1a9e0715063b4f9c65585281a869 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Sat, 23 Feb 2019 12:23:34 +0100 Subject: Drop include/o3tl/make_unique.hxx In favor of std::make_unique Change-Id: I0428076a10fb7b61c5add994c9970661b375b82c Reviewed-on: https://gerrit.libreoffice.org/68254 Tested-by: Jenkins Reviewed-by: Julien Nabet Reviewed-by: Noel Grandin --- include/o3tl/make_unique.hxx | 51 -------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 include/o3tl/make_unique.hxx (limited to 'include/o3tl') diff --git a/include/o3tl/make_unique.hxx b/include/o3tl/make_unique.hxx deleted file mode 100644 index 555e9ca538b8..000000000000 --- a/include/o3tl/make_unique.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_O3TL_MAKE_UNIQUE_HXX -#define INCLUDED_O3TL_MAKE_UNIQUE_HXX - -#include -#include -#include - -namespace o3tl -{ - -/** - * Constructs an object of type T and wraps it in a std::unique_ptr. - * - * Can be replaced by std::make_unique when we allow C++14. - */ -template -typename std::enable_if::value, std::unique_ptr>::type -make_unique(Args&& ... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -/** - * for arrays - */ -template -typename std::enable_if -< - std::is_array::value, - std::unique_ptr ->::type -make_unique(std::size_t n) -{ - typedef typename std::remove_extent::type RT; - return std::unique_ptr(new RT[n]); -} - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit