Opened 6 years ago

Last modified 6 years ago

#12918 new Bugs

Spirit:extra template parameters in mini_c sample

Reported by: lisi <942748117@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.63.0 Severity: Problem
Keywords: mini_c parameters Cc: 942748117@…

Description

as the following code shows,
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

#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) {}
                           .
                           .
                           .
      }
}

Change History (2)

comment:1 by timmyli, 6 years ago

Cc: 942748117@… added

comment:2 by Kohei Takahashi, 6 years ago

Component: Nonespirit
Owner: set to Joel de Guzman
Note: See TracTickets for help on using tickets.