From 8d787261f12dfe711bc3bb4e088bf9bf42592b49 Mon Sep 17 00:00:00 2001
From: znone <glyc@sina.com.cn>
Date: Tue, 11 Sep 2018 03:07:25 +0000
Subject: [PATCH] 可以通过 qtl::custom_bind 把不同数据集用不同的绑定函数绑定到同一结构。
---
include/apply_tuple.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/include/apply_tuple.h b/include/apply_tuple.h
index 6857925..2f47dbc 100644
--- a/include/apply_tuple.h
+++ b/include/apply_tuple.h
@@ -6,6 +6,8 @@
#include <type_traits>
#include <utility>
+#if __cplusplus < 201703L
+
namespace detail
{
template<size_t N>
@@ -46,4 +48,14 @@
>::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
+
#endif //_APPLY_TUPLE_H_
--
Gitblit v1.9.3