From ba278becbd123498e11535dac4671d8bd128bbfe Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Sat, 10 Mar 2018 23:29:22 -0800 Subject: [PATCH] Don't use #pragma; don't redefine make_unique if using C++14 --- include/stdshims.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/stdshims.h b/include/stdshims.h index 14958e1fc..86e355d04 100644 --- a/include/stdshims.h +++ b/include/stdshims.h @@ -1,14 +1,17 @@ //! Shims for std:: functions that aren't available in the current C++ versions //! we target. -#pragma once +#ifndef STDSHIMS_H +#define STDSHIMS_H #include #include #if (__cplusplus >= 201402L) #warning "This file should now be removed! The functions it provides are part of the C++14 standard." -#endif +using std::unique_ptr; + +#else /// Shim for http://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique template @@ -16,4 +19,7 @@ std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } +#endif + +#endif // include guard