Am 24.10.2010 17:23, schrieb Mateusz Loskot:
On 21/10/10 10:26, Henning Basold wrote:
The integration of arbitrary fusion sequences works by using SFINAE (the
new parameter to type_conversion). A specialization of type_conversion
is then enabled iff the parameter T models a fusion sequence.
Have you compiled any program using SOCI with both,
boost::fusion (with boost::tuple as sequence enabled)
and the original boost::tuple support?
It is a program using soci/core/boost-tuple.h and
soci/core/boost-fusion.h
I'm wondering how if/how you solved it.
Best regards,
Hi,
I have been away visiting relatives over the weekend. So sorry for not
responding so far.
No I have not combined adapted boost::tuple and the support for it
through SOCI (headers <boost-fusion.h> vs.
<boost/fusion/adapted/boost_tuple.hpp>). Hope you mean that. But the
combination cannot be possible because the instantiations are ambiguous.
There are two possible solutions:
1. warn users that those headers cannot be combined (not a real solution)
2. if the correct boost version is present include the fusion adaption
else use the current implementation.
I've attached a patch which implements the second solution. But the user
may be noted that this is just for backwards compatibility. It would be
better if future adaption of tuple is done through Boost.Fusion.
Best regards
Henning
>From ad3b3792e74e07e2ebf525a60d591383621c38a1 Mon Sep 17 00:00:00 2001
From: Henning Basold <[email protected]>
Date: Mon, 25 Oct 2010 09:26:42 +0200
Subject: [PATCH 2/2] Make Fusion and Tuple support compatible
---
src/core/boost-tuple.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/core/boost-tuple.h b/src/core/boost-tuple.h
index 55e75b3..7cf8240 100644
--- a/src/core/boost-tuple.h
+++ b/src/core/boost-tuple.h
@@ -13,6 +13,8 @@
// boost
#include <boost/tuple/tuple.hpp>
+#if defined(BOOST_VERSION) && BOOST_VERSION < 103500
+
namespace soci
{
@@ -314,4 +316,9 @@ struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
} // namespace soci
+#else // BOOST_VERSION >= 103500
+# include "boost-fusion.h"
+# include <boost/fusion/adapted/boost_tuple.hpp>
+#endif
+
#endif // SOCI_BOOST_TUPLE_H_INCLUDED
--
1.7.0.4
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users