|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58437 - trunk/boost/spirit/home/support/auto
From: hartmut.kaiser_at_[hidden]
Date: 2009-12-17 12:05:42
Author: hkaiser
Date: 2009-12-17 12:05:42 EST (Thu, 17 Dec 2009)
New Revision: 58437
URL: http://svn.boost.org/trac/boost/changeset/58437
Log:
Spirit: applied workaround in auto_ support for older versions of g++ (< V4.1)
Text files modified:
trunk/boost/spirit/home/support/auto/meta_create.hpp | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
Modified: trunk/boost/spirit/home/support/auto/meta_create.hpp
==============================================================================
--- trunk/boost/spirit/home/support/auto/meta_create.hpp (original)
+++ trunk/boost/spirit/home/support/auto/meta_create.hpp 2009-12-17 12:05:42 EST (Thu, 17 Dec 2009)
@@ -20,6 +20,11 @@
#include <boost/type_traits/remove_reference.hpp>
#include <boost/fusion/include/fold.hpp>
+// needed for workaround below
+#if defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 1))
+#include <boost/type_traits/is_same.hpp>
+#endif
+
namespace boost { namespace spirit { namespace traits
{
///////////////////////////////////////////////////////////////////////////
@@ -54,9 +59,18 @@
template <typename T>
struct result;
+// this is a workaround for older versions of g++ (< V4.1) which apparently have
+// problems with the following template specialization
+#if defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 1))
+ template <typename F, typename T1, typename T2>
+ struct result<F(T1, T2)>
+ {
+ BOOST_STATIC_ASSERT((is_same<F, nary_proto_expr_function>::value));
+#else
template <typename T1, typename T2>
struct result<nary_proto_expr_function(T1, T2)>
{
+#endif
typedef typename remove_const_ref<T1>::type left_type;
typedef typename
spirit::traits::meta_create<Domain, T2>::type
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk