Remove make_unique compat

pull/1087/head
Levin Li 2021-06-13 15:09:36 +08:00
parent fbc165c9d6
commit 5d1bcc2256
5 changed files with 1 additions and 25 deletions

View File

@ -401,8 +401,6 @@ endif()
try_compile(HAVE_STRING_VIEW ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/checks/cxxsv.cpp")
try_compile(HAVE_EXPERIMENTAL_STRING_VIEW ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/checks/cxxsvexp.cpp")
try_compile(HAVE_MAKE_UNIQUE ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/checks/unique.cpp")
configure_file("config.h.in" "config.h")
set(BASE_DATA_SOURCES

View File

@ -1,6 +0,0 @@
#include <memory>
int main()
{
auto ptr = std::make_unique<int>(5);
}

View File

@ -3,5 +3,4 @@
#cmakedefine HAVE_EXPERIMENTAL_FILESYSTEM
#cmakedefine HAVE_STRING_VIEW
#cmakedefine HAVE_EXPERIMENTAL_STRING_VIEW
#cmakedefine HAVE_MAKE_UNIQUE
#cmakedefine HAVE_WORDEXP

View File

@ -1,15 +0,0 @@
#pragma once
#include <config.h>
#include <memory>
#ifndef HAVE_MAKE_UNIQUE
namespace std
{
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}
#endif

View File

@ -12,7 +12,7 @@
#include <fstream>
#include <string>
#include <celcompat/memory.h>
#include <memory>
#include <celutil/filetype.h>
#include <celutil/timer.h>
#include <celutil/watcher.h>