Don't use #pragma; don't redefine make_unique if using C++14
This commit is contained in:
@@ -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 <memory>
|
||||
#include <utility>
|
||||
|
||||
#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<typename T, typename... Args>
|
||||
@@ -16,4 +19,7 @@ std::unique_ptr<T> make_unique(Args&&... args)
|
||||
{
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user