merge #20413: Require C++17 compiler

This commit is contained in:
Kittywhiskers Van Gogh 2020-06-06 23:35:51 +02:00
parent f9505c7133
commit 140997f4b7
2 changed files with 4 additions and 13 deletions

View File

@ -61,18 +61,8 @@ case $host in
;;
esac
AC_ARG_ENABLE([c++17],
[AS_HELP_STRING([--enable-c++17],
[enable compilation in c++17 mode (disabled by default)])],
[use_cxx17=$enableval],
[use_cxx17=no])
dnl Require C++14 or C++17 compiler (no GNU extensions)
if test "x$use_cxx17" = xyes; then
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
else
AX_CXX_COMPILE_STDCXX([14], [noext], [mandatory])
fi
dnl Require C++17 compiler (no GNU extensions)
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
dnl Check if -latomic is required for <std::atomic>
CHECK_ATOMIC

View File

@ -10,10 +10,11 @@
#include <utility>
//! Substitute for C++14 std::make_unique.
//! DEPRECATED use std::make_unique in new code.
template <typename T, typename... Args>
std::unique_ptr<T> MakeUnique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
return std::make_unique<T>(std::forward<Args>(args)...);
}
#endif