From 5d0c70278e9ddcd3ec2adcad0281458e25315afe Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:55:04 -0700 Subject: [PATCH] Delete apply.h (#1763) --- CMakeLists.txt | 1 - lib/inc/drogon/utils/apply.h | 46 ------------------------------- orm_lib/inc/drogon/orm/Criteria.h | 5 ++-- 3 files changed, 2 insertions(+), 50 deletions(-) mode change 100755 => 100644 CMakeLists.txt delete mode 100644 lib/inc/drogon/utils/apply.h diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 356fe2fa..7e93ac5a --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -685,7 +685,6 @@ set(NOSQL_HEADERS install(FILES ${NOSQL_HEADERS} DESTINATION ${INSTALL_INCLUDE_DIR}/drogon/nosql) set(DROGON_UTIL_HEADERS - lib/inc/drogon/utils/apply.h lib/inc/drogon/utils/coroutine.h lib/inc/drogon/utils/FunctionTraits.h lib/inc/drogon/utils/HttpConstraint.h diff --git a/lib/inc/drogon/utils/apply.h b/lib/inc/drogon/utils/apply.h deleted file mode 100644 index c1e36e02..00000000 --- a/lib/inc/drogon/utils/apply.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * package.h - * An Tao - * - * Copyright 2018, An Tao. All rights reserved. - * https://github.com/an-tao/drogon - * Use of this source code is governed by a MIT license - * that can be found in the License file. - * - * Drogon - * - */ - -#pragma once -#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) -#include -#else -#include - -namespace -{ -template -constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence) -{ - return static_cast(f)(std::get(static_cast(t))...); -} -} // anonymous namespace -#endif - -namespace drogon -{ -#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) -using std::apply; -#else -template -constexpr decltype(auto) apply(F &&f, Tuple &&t) -{ - return apply_impl( - std::forward(f), - std::forward(t), - std::make_index_sequence< - std::tuple_size >::value>{}); -} -#endif -} // namespace drogon \ No newline at end of file diff --git a/orm_lib/inc/drogon/orm/Criteria.h b/orm_lib/inc/drogon/orm/Criteria.h index 5216f3e8..3c659890 100644 --- a/orm_lib/inc/drogon/orm/Criteria.h +++ b/orm_lib/inc/drogon/orm/Criteria.h @@ -16,7 +16,6 @@ #include #include -#include #include #include #include @@ -120,7 +119,7 @@ class DROGON_EXPORT Criteria outputArgumentsFunc_ = [args = std::make_tuple(std::forward(args)...)]( internal::SqlBinder &binder) mutable { - return apply( + return std::apply( [&binder](auto &&...args) { (void)std::initializer_list{ (binder << std::forward(args), 0)...}; @@ -136,7 +135,7 @@ class DROGON_EXPORT Criteria outputArgumentsFunc_ = [args = std::make_tuple(std::forward(args)...)]( internal::SqlBinder &binder) mutable { - return apply( + return std::apply( [&binder](auto &&...args) { (void)std::initializer_list{ (binder << std::forward(args), 0)...};