mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-29 18:27:43 +08:00
Delete apply.h (#1763)
This commit is contained in:
parent
366311c196
commit
5d0c70278e
1
CMakeLists.txt
Executable file → Normal file
1
CMakeLists.txt
Executable file → Normal 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
|
||||
|
@ -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
|
@ -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)...};
|
||||
|
Loading…
Reference in New Issue
Block a user