mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-24 06:37:49 +08:00
010e88c647
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
76 lines
3.0 KiB
Diff
76 lines
3.0 KiB
Diff
From 5c3b1e0a61d83d7a3c70fb882c7e0918777f0e00 Mon Sep 17 00:00:00 2001
|
|
From: Andrei Lebedev <lebdron@gmail.com>
|
|
Date: Sun, 5 May 2019 19:52:01 +0300
|
|
Subject: [PATCH] Deduce reference in boost::fusion::for_each
|
|
|
|
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
|
|
---
|
|
include/soci/bind-values.h | 27 +++++++++++++++++++++++----
|
|
1 file changed, 23 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/include/soci/bind-values.h b/include/soci/bind-values.h
|
|
index eee416e..e84fb0e 100644
|
|
--- a/include/soci/bind-values.h
|
|
+++ b/include/soci/bind-values.h
|
|
@@ -13,6 +13,13 @@
|
|
#ifdef SOCI_HAVE_BOOST
|
|
# include <boost/fusion/algorithm/iteration/for_each.hpp>
|
|
# include <boost/mpl/bool.hpp>
|
|
+# include <boost/version.hpp>
|
|
+
|
|
+# if BOOST_VERSION >= 106800
|
|
+# define SOCI_BOOST_FUSION_FOREACH_REFERENCE &
|
|
+# else
|
|
+# define SOCI_BOOST_FUSION_FOREACH_REFERENCE
|
|
+# endif
|
|
#endif // SOCI_HAVE_BOOST
|
|
#include <vector>
|
|
|
|
@@ -83,13 +90,19 @@ private:
|
|
template <typename T, typename Indicator>
|
|
void exchange_(use_container<T, Indicator> const &uc, boost::mpl::true_ * /* fusion sequence */)
|
|
{
|
|
- boost::fusion::for_each(uc.t, use_sequence<T, Indicator>(*this, uc.ind));
|
|
+ use_sequence<T, Indicator> f(*this, uc.ind);
|
|
+ boost::fusion::for_each<T,
|
|
+ use_sequence<T, Indicator>
|
|
+ SOCI_BOOST_FUSION_FOREACH_REFERENCE>(uc.t, f);
|
|
}
|
|
|
|
template <typename T>
|
|
void exchange_(use_container<T, details::no_indicator> const &uc, boost::mpl::true_ * /* fusion sequence */)
|
|
{
|
|
- boost::fusion::for_each(uc.t, use_sequence<T, details::no_indicator>(*this));
|
|
+ use_sequence<T, details::no_indicator> f(*this);
|
|
+ boost::fusion::for_each<T,
|
|
+ use_sequence<T, details::no_indicator>
|
|
+ SOCI_BOOST_FUSION_FOREACH_REFERENCE>(uc.t, f);
|
|
}
|
|
|
|
#endif // SOCI_HAVE_BOOST
|
|
@@ -173,13 +186,19 @@ private:
|
|
template <typename T, typename Indicator>
|
|
void exchange_(into_container<T, Indicator> const &ic, boost::mpl::true_ * /* fusion sequence */)
|
|
{
|
|
- boost::fusion::for_each(ic.t, into_sequence<T, Indicator>(*this, ic.ind));
|
|
+ into_sequence<T, Indicator> f(*this, ic.ind);
|
|
+ boost::fusion::for_each<T,
|
|
+ into_sequence<T, Indicator>
|
|
+ SOCI_BOOST_FUSION_FOREACH_REFERENCE>(ic.t, f);
|
|
}
|
|
|
|
template <typename T>
|
|
void exchange_(into_container<T, details::no_indicator> const &ic, boost::mpl::true_ * /* fusion sequence */)
|
|
{
|
|
- boost::fusion::for_each(ic.t, into_sequence<T, details::no_indicator>(*this));
|
|
+ into_sequence<T, details::no_indicator> f(*this);
|
|
+ boost::fusion::for_each<T,
|
|
+ into_sequence<T, details::no_indicator>
|
|
+ SOCI_BOOST_FUSION_FOREACH_REFERENCE>(ic.t, f);
|
|
}
|
|
#endif // SOCI_HAVE_BOOST
|
|
|
|
--
|
|
2.20.1.windows.1
|
|
|