Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52685 - trunk/boost/spirit/home/support
From: hartmut.kaiser_at_[hidden]
Date: 2009-04-30 13:05:30


Author: hkaiser
Date: 2009-04-30 13:05:29 EDT (Thu, 30 Apr 2009)
New Revision: 52685
URL: http://svn.boost.org/trac/boost/changeset/52685

Log:
Spirit: Applied some changes to the result_of::terminal metafunction.
Text files modified:
   trunk/boost/spirit/home/support/common_terminals.hpp | 1
   trunk/boost/spirit/home/support/terminal.hpp | 41 ++++++++++++++++++++++++++-------------
   2 files changed, 27 insertions(+), 15 deletions(-)

Modified: trunk/boost/spirit/home/support/common_terminals.hpp
==============================================================================
--- trunk/boost/spirit/home/support/common_terminals.hpp (original)
+++ trunk/boost/spirit/home/support/common_terminals.hpp 2009-04-30 13:05:29 EDT (Thu, 30 Apr 2009)
@@ -73,7 +73,6 @@
         ( right_align )
         ( center )
         ( maxwidth )
- ( confix )
         ( set_state )
         ( in_state )
         ( token )

Modified: trunk/boost/spirit/home/support/terminal.hpp
==============================================================================
--- trunk/boost/spirit/home/support/terminal.hpp (original)
+++ trunk/boost/spirit/home/support/terminal.hpp 2009-04-30 13:05:29 EDT (Thu, 30 Apr 2009)
@@ -280,6 +280,7 @@
             type;
         };
 
+ // FIXME: we need to change this to conform to the result_of protocol
         template <
             typename A0
           , typename A1 = unused_type
@@ -295,7 +296,6 @@
             type;
         };
 
-
         // Note: in the following overloads, SFINAE cannot
         // be done on return type because of gcc bug #24915:
         // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24915
@@ -388,28 +388,41 @@
     };
 
     ///////////////////////////////////////////////////////////////////////////
- namespace traits
+ namespace result_of
     {
+ template <typename Sig>
+ struct terminal;
+
         // Calculate the type of the compound terminal if generated by one of
         // the spirit::terminal::operator() overloads above
- template <
- typename Tag
- , typename A0 = unused_type
- , typename A1 = unused_type
- , typename A2 = unused_type
- >
- struct terminal
- {
- typedef typename spirit::terminal<Tag>::
- template result<A0, A1, A2>::type type;
- };
 
         // The terminal type itself is passed through without modification
         template <typename Tag>
- struct terminal<Tag, unused_type, unused_type, unused_type>
+ struct terminal<Tag()>
         {
             typedef spirit::terminal<Tag> type;
         };
+
+ template <typename Tag, typename A0>
+ struct terminal<Tag(A0)>
+ {
+ typedef typename spirit::terminal<Tag>::
+ template result<A0>::type type;
+ };
+
+ template <typename Tag, typename A0, typename A1>
+ struct terminal<Tag(A0, A1)>
+ {
+ typedef typename spirit::terminal<Tag>::
+ template result<A0, A1>::type type;
+ };
+
+ template <typename Tag, typename A0, typename A1, typename A2>
+ struct terminal<Tag(A0, A1, A2)>
+ {
+ typedef typename spirit::terminal<Tag>::
+ template result<A0, A1, A2>::type 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