Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58565 - in trunk/boost/spirit/home: karma/auto qi/auto support/auto
From: hartmut.kaiser_at_[hidden]
Date: 2009-12-29 11:40:04


Author: hkaiser
Date: 2009-12-29 11:40:03 EST (Tue, 29 Dec 2009)
New Revision: 58565
URL: http://svn.boost.org/trac/boost/changeset/58565

Log:
Spirit: tweaks for auto_ support
Text files modified:
   trunk/boost/spirit/home/karma/auto/create_generator.hpp | 13 ++++++++++++-
   trunk/boost/spirit/home/qi/auto/create_parser.hpp | 14 ++++++++++++--
   trunk/boost/spirit/home/qi/auto/meta_create.hpp | 2 +-
   trunk/boost/spirit/home/support/auto/meta_create.hpp | 6 +++---
   4 files changed, 28 insertions(+), 7 deletions(-)

Modified: trunk/boost/spirit/home/karma/auto/create_generator.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auto/create_generator.hpp (original)
+++ trunk/boost/spirit/home/karma/auto/create_generator.hpp 2009-12-29 11:40:03 EST (Tue, 29 Dec 2009)
@@ -12,6 +12,7 @@
 
 #include <boost/spirit/home/karma/auto/meta_create.hpp>
 
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace spirit { namespace result_of
 {
     ///////////////////////////////////////////////////////////////////////////
@@ -20,9 +21,9 @@
       : spirit::traits::meta_create<karma::domain, T> {};
 }}}
 
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace spirit { namespace karma
 {
- ///////////////////////////////////////////////////////////////////////////
     // Main API function for generator creation from data type
     template <typename T>
     typename result_of::create_generator<T>::type
@@ -32,4 +33,14 @@
     }
 }}}
 
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace traits
+{
+ // Meta function returning true if create_generator does return a valid
+ // generator for the given type T.
+ template <typename T>
+ struct create_generator_exists
+ : meta_create_exists<karma::domain, T> {};
+}}}
+
 #endif

Modified: trunk/boost/spirit/home/qi/auto/create_parser.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/auto/create_parser.hpp (original)
+++ trunk/boost/spirit/home/qi/auto/create_parser.hpp 2009-12-29 11:40:03 EST (Tue, 29 Dec 2009)
@@ -12,17 +12,17 @@
 
 #include <boost/spirit/home/qi/auto/meta_create.hpp>
 
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace spirit { namespace result_of
 {
- ///////////////////////////////////////////////////////////////////////////
     template <typename T>
     struct create_parser
       : spirit::traits::meta_create<qi::domain, T> {};
 }}}
 
+///////////////////////////////////////////////////////////////////////////////
 namespace boost { namespace spirit { namespace qi
 {
- ///////////////////////////////////////////////////////////////////////////
     // Main API function for parser creation from data type
     template <typename T>
     typename result_of::create_parser<T>::type
@@ -32,4 +32,14 @@
     }
 }}}
 
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace traits
+{
+ // Meta function returning true if create_parser does return a valid
+ // parser for the given type T.
+ template <typename T>
+ struct create_parser_exists
+ : meta_create_exists<qi::domain, T> {};
+}}}
+
 #endif

Modified: trunk/boost/spirit/home/qi/auto/meta_create.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/auto/meta_create.hpp (original)
+++ trunk/boost/spirit/home/qi/auto/meta_create.hpp 2009-12-29 11:40:03 EST (Tue, 29 Dec 2009)
@@ -74,7 +74,7 @@
     // STL container or a fusion sequence
 
     // The default implementation will be chosen if no predefined mapping of
- // the data type T to a Karma component is defined.
+ // the data type T to a Qi component is defined.
     struct no_auto_mapping_exists {};
 
     template <typename T, typename Enable = void>

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-29 11:40:03 EST (Tue, 29 Dec 2009)
@@ -28,12 +28,12 @@
 namespace boost { namespace spirit { namespace traits
 {
     ///////////////////////////////////////////////////////////////////////////
- // This is the main dispatching point for meta_create to the correct domain
+ // This is the main dispatch point for meta_create to the correct domain
     template <typename Domain, typename T, typename Enable = void>
     struct meta_create;
 
     ///////////////////////////////////////////////////////////////////////////
- // This allows to query whether a valid mapping exits for the given data
+ // This allows to query whether a valid mapping exists for the given data
     // type to a component in the given domain
     template <typename Domain, typename T, typename Enable = void>
     struct meta_create_exists : mpl::false_ {};
@@ -61,7 +61,7 @@
 
 // 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))
+#if defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 2))
             template <typename F, typename T1, typename T2>
             struct result<F(T1, T2)>
             {


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