Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59323 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-01-27 17:07:09


Author: danieljames
Date: 2010-01-27 17:07:08 EST (Wed, 27 Jan 2010)
New Revision: 59323
URL: http://svn.boost.org/trac/boost/changeset/59323

Log:
Use a reverse view to set the author name pair.
Text files modified:
   branches/quickbook-1.5-spirit2/doc_info.cpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: branches/quickbook-1.5-spirit2/doc_info.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info.cpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info.cpp 2010-01-27 17:07:08 EST (Wed, 27 Jan 2010)
@@ -23,6 +23,7 @@
 #include <boost/spirit/include/phoenix_operator.hpp>
 #include <boost/spirit/include/phoenix_fusion.hpp>
 #include <boost/fusion/include/std_pair.hpp>
+#include <boost/fusion/include/reverse_view.hpp>
 
 namespace quickbook
 {
@@ -64,7 +65,8 @@
         qi::rule<iterator, std::string()> phrase, doc_version, doc_id, doc_dirname, doc_category, doc_last_revision, doc_source_mode, doc_purpose, doc_license;
         qi::rule<iterator, std::pair<std::vector<std::string>, std::string>()> doc_copyright;
         qi::rule<iterator, std::vector<std::pair<std::string, std::string> >()> doc_authors;
- qi::rule<iterator, std::pair<std::string, std::string>()> doc_author;
+ qi::rule<iterator, boost::fusion::reverse_view<
+ std::pair<std::string, std::string> >()> doc_author;
     };
 
     doc_info_grammar::doc_info_grammar(quickbook::actions& actions)
@@ -153,9 +155,9 @@
                 space
>> '['
>> space
- >> (*(qi::char_ - ',')) [member_assign(&std::pair<std::string, std::string>::second)]
+ >> (*(qi::char_ - ','))
>> ',' >> space
- >> (*(qi::char_ - ']')) [member_assign(&std::pair<std::string, std::string>::first)]
+ >> (*(qi::char_ - ']'))
>> ']'
             ;
 


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