Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61123 - trunk/boost/spirit/home/support
From: hartmut.kaiser_at_[hidden]
Date: 2010-04-07 09:16:54


Author: hkaiser
Date: 2010-04-07 09:16:53 EDT (Wed, 07 Apr 2010)
New Revision: 61123
URL: http://svn.boost.org/trac/boost/changeset/61123

Log:
Spirit: fixing attribute transformation ambiguity
Text files modified:
   trunk/boost/spirit/home/support/attributes.hpp | 30 ++++++++++++++++++++----------
   1 files changed, 20 insertions(+), 10 deletions(-)

Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2010-04-07 09:16:53 EDT (Wed, 07 Apr 2010)
@@ -520,6 +520,16 @@
         static void fail(Exposed&) {}
     };
 
+ // handle case where no transformation is required as the types are the same
+ template <typename Attribute>
+ struct default_transform_attribute<Attribute, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute&, Attribute const&) {}
+ static void fail(Attribute&) {}
+ };
+
     template <typename Exposed, typename Transformed>
     struct proxy_transform_attribute
     {
@@ -532,6 +542,16 @@
         static void fail(Exposed&) {}
     };
 
+ // handle case where no transformation is required as the types are the same
+ template <typename Attribute>
+ struct proxy_transform_attribute<Attribute, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute&, Attribute const&) {}
+ static void fail(Attribute&) {}
+ };
+
     template <typename Exposed, typename Transformed, typename Enable/* = void*/>
     struct transform_attribute
       : default_transform_attribute<Exposed, Transformed> {};
@@ -573,16 +593,6 @@
         }
     };
 
- // handle case where no transformation is required as the types are the same
- template <typename Attribute>
- struct transform_attribute<Attribute, Attribute>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- static void fail(Attribute&) {}
- };
-
     template <typename Attribute>
     struct transform_attribute<Attribute const, Attribute>
     {


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