[Boost-bugs] [Boost C++ Libraries] #12918: Spirit:extra template parameters in mini_c sample

Subject: [Boost-bugs] [Boost C++ Libraries] #12918: Spirit:extra template parameters in mini_c sample
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-20 12:04:41


#12918: Spirit:extra template parameters in mini_c sample
--------------------------------+-------------------------------
 Reporter: lisi <942748117@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.63.0
 Severity: Problem | Keywords: mini_c parameters
--------------------------------+-------------------------------
 as the following code shows,[[BR]]
 '''boost_1_63_0\boost\utility\result_of.hpp'''
 {{{
                   .
                   .
                   .
 template<typename F, typename FArgs>
 struct result_of_nested_result : F::template result<FArgs>
 {};
                   .
                   .
                   .
 }}}
 struct '''result''' only needs one template parameter.But in the next two
 files in mini_c sample, '''result''' is provided more template
 parameters. Because of this, the code can't ran successfully.

 '''I write "/* */" behind the code need to be removed'''

 '''boost_1_63_0\libs\spirit\example\qi\compiler_tutorial\mini_c\annotation.hpp'''[[BR]]

 {{{
 #if !defined(BOOST_SPIRIT_MINIC_ANNOTATION_HPP)
 #define BOOST_SPIRIT_MINIC_ANNOTATION_HPP

 #include <map>
 #include <boost/variant/apply_visitor.hpp>
 #include <boost/type_traits/is_base_of.hpp>
 #include <boost/mpl/bool.hpp>
 #include "ast.hpp"

 namespace client
 {
     template <typename Iterator>
     struct annotation
     {
         template <typename,typename> /*the second "typename" need to be
 removed*/
         struct result { typedef void type; };

         std::vector<Iterator>& iters;
         annotation(std::vector<Iterator>& iters)
           : iters(iters) {}
                     .
                     .
                     .
      }
 }
 }}}

 '''boost_1_63_0\libs\spirit\example\qi\compiler_tutorial\mini_c\error_handler.hpp'''

 {{{
 #if !defined(BOOST_SPIRIT_MINIC_ERROR_HANDLER_HPP)
 #define BOOST_SPIRIT_MINIC_ERROR_HANDLER_HPP

 #include <iostream>
 #include <string>
 #include <vector>

 namespace client
 {
     template <typename Iterator>
     struct error_handler
     {
         template <typename, typename, typename> /*the second and the
 third "typename" need to be removed*/
         struct result { typedef void type; };

         error_handler(Iterator first, Iterator last)
           : first(first), last(last) {}
                            .
                            .
                            .
       }
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12918>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-03-20 12:07:43 UTC