From 9040b187a1c4fa380f8a12207b9dd6d04b3a10ac Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Aug 2016 18:00:49 +0200 Subject: all: rename modules s#^opentrack-##. and opentrack -> api Adjust usages. --- opentrack-compat/make-unique.hpp | 43 ---------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 opentrack-compat/make-unique.hpp (limited to 'opentrack-compat/make-unique.hpp') diff --git a/opentrack-compat/make-unique.hpp b/opentrack-compat/make-unique.hpp deleted file mode 100644 index bb5315c5..00000000 --- a/opentrack-compat/make-unique.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -// GNU 5.4.0 doesn't have std::make_unique in -std=c++14 mode - -// this implementation was taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm - -#include -#include -#include - -namespace detail { -template struct Unique_if -{ - typedef std::unique_ptr Single_object; -}; - -template struct Unique_if -{ - typedef std::unique_ptr Unknown_bound; -}; - -template struct Unique_if -{ - typedef void Known_bound; -}; -} - -template - typename detail::Unique_if::Single_object - make_unique(Args&&... args) { - return std::unique_ptr(new T(std::forward(args)...)); - } - -template - typename detail::Unique_if::Unknown_bound - make_unique(std::size_t n) { - typedef typename std::remove_extent::type U; - return std::unique_ptr(new U[n]()); - } - -template - typename detail::Unique_if::Known_bound - make_unique(Args&&...) = delete; -- cgit v1.2.3