From 14337cf5b302c5385f0ae1393caf6df7e83fc539 Mon Sep 17 00:00:00 2001
From: znone <glyc@sina.com.cn>
Date: Sat, 07 Dec 2019 06:52:19 +0000
Subject: [PATCH] 1. 允许绑定字段到std::optional和std::any 2. 增加函数bind_fields可以一次绑定到多个字段 3. 查询函数返回数据库对象自身,以支持链式调用
---
include/apply_tuple.h | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/apply_tuple.h b/include/apply_tuple.h
index 2f47dbc..3e37cd9 100644
--- a/include/apply_tuple.h
+++ b/include/apply_tuple.h
@@ -6,7 +6,15 @@
#include <type_traits>
#include <utility>
-#if __cplusplus < 201703L
+#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
+
+template <class F, class Tuple>
+inline constexpr decltype(auto) apply_tuple(F&& f, Tuple&& t)
+{
+ return std::apply(std::forward<F>(f), std::forward<Tuple>(t));
+}
+
+#else
namespace detail
{
@@ -46,14 +54,6 @@
return detail::apply< std::tuple_size<
typename std::decay<T>::type
>::value>::apply_tuple(std::forward<F>(f), std::forward<T>(t));
-}
-
-#else
-
-template <class F, class Tuple>
-inline constexpr decltype(auto) apply_tuple(F&& f, Tuple&& t)
-{
- return std::apply(std;:forward<F>(f), std::forward<Tuple>(t));
}
#endif // C++17
--
Gitblit v1.9.3