Delete apply.h (#1763)

This commit is contained in:
Ken Matsui 2023-08-28 22:55:04 -07:00 committed by GitHub
parent 366311c196
commit 5d0c70278e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 50 deletions

1
CMakeLists.txt Executable file → Normal file
View File

@ -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

View File

@ -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 <tuple>
#else
#include <utility>
namespace
{
template <typename F, typename Tuple, std::size_t... I>
constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence<I...>)
{
return static_cast<F &&>(f)(std::get<I>(static_cast<Tuple &&>(t))...);
}
} // anonymous namespace
#endif
namespace drogon
{
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
using std::apply;
#else
template <typename F, typename Tuple>
constexpr decltype(auto) apply(F &&f, Tuple &&t)
{
return apply_impl(
std::forward<F>(f),
std::forward<Tuple>(t),
std::make_index_sequence<
std::tuple_size<std::remove_reference_t<Tuple> >::value>{});
}
#endif
} // namespace drogon

View File

@ -16,7 +16,6 @@
#include <drogon/exports.h>
#include <drogon/orm/SqlBinder.h>
#include <drogon/utils/apply.h>
#include <assert.h>
#include <memory>
#include <string>
@ -120,7 +119,7 @@ class DROGON_EXPORT Criteria
outputArgumentsFunc_ =
[args = std::make_tuple(std::forward<Arguments>(args)...)](
internal::SqlBinder &binder) mutable {
return apply(
return std::apply(
[&binder](auto &&...args) {
(void)std::initializer_list<int>{
(binder << std::forward<Arguments>(args), 0)...};
@ -136,7 +135,7 @@ class DROGON_EXPORT Criteria
outputArgumentsFunc_ =
[args = std::make_tuple(std::forward<Arguments>(args)...)](
internal::SqlBinder &binder) mutable {
return apply(
return std::apply(
[&binder](auto &&...args) {
(void)std::initializer_list<int>{
(binder << std::forward<Arguments>(args), 0)...};