Spirit grammar won't compile: function template argument error?C++: hashtable - Why won't this compile?Boost::Spirit compilation errorspirit::qi::grammar-name with different char sizeHow do I grok boost spirit compiler errorsUsing simple Boost::Spirit grammars?Compiling boost::move in gcc 4.6.4No viable conversion error from boost::spirit::unused_typeboost::property_tree::read_json in gcc 4.7.2 and boost 1.49 - compile-time errorsError compiling a custom container for boost spiritboost::spirit recursive imperative c++ grammar: BOOST_FUSION_ADAPT_STRUCT fails

why do people keep saying me that I am a horrible photographer?

How can I close a gap between my fence and my neighbor's that's on his side of the property line?

As matter approaches a black hole, does it speed up?

Why are prions in animal diets not destroyed by the digestive system?

What does a spell range of "25 ft. + 5 ft./2 levels" mean?

Verb "geeitet" in an old scientific text

Where can I go to avoid planes overhead?

Has a commercial or military jet bi-plane ever been manufactured?

What does this colon mean? It is not labeling, it is not ternary operator

I have a unique character that I'm having a problem writing. He's a virus!

How did Kirk identify Gorgan in "And the Children Shall Lead"?

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

Double or Take game

BOOM! Perfect Clear for Mr. T

Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?

Pressure inside an infinite ocean?

String won't reverse using reverse_copy

Why is "Vayechulu" said 3 times on Leil Shabbat?

Can Infinity Stones be retrieved more than once?

Purpose of のは in this sentence?

Are there any Final Fantasy Spirits in Super Smash Bros Ultimate?

What to use instead of cling film to wrap pastry

Which module had more 'comfort' in terms of living space, the Lunar Module or the Command module?

Hyperlink on red background



Spirit grammar won't compile: function template argument error?


C++: hashtable - Why won't this compile?Boost::Spirit compilation errorspirit::qi::grammar-name with different char sizeHow do I grok boost spirit compiler errorsUsing simple Boost::Spirit grammars?Compiling boost::move in gcc 4.6.4No viable conversion error from boost::spirit::unused_typeboost::property_tree::read_json in gcc 4.7.2 and boost 1.49 - compile-time errorsError compiling a custom container for boost spiritboost::spirit recursive imperative c++ grammar: BOOST_FUSION_ADAPT_STRUCT fails






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Compiling this simple Spirit grammar results in what seems to be a single error (despite the huge error message), possibly having to do with my skipper or some other template parameter that I have mistakenly used.



I experimented with a variety of attribute definitions for the grammar and the start rule, but it had no effect on the error.



#include <string>
#include "/usr/local/boost/include/boost/spirit/include/qi.hpp"
#include "/usr/local/boost/include/boost/spirit/include/qi_symbols.hpp"

using std::string;

namespace qi = boost::spirit::qi;
namespace ascii = boost::spirit::ascii;

boost::spirit::qi::rule<string::const_iterator>
skipper_rule = qi::space | '#' >> *(qi::char_ - qi::eol) >> qi::eol;

typedef BOOST_TYPEOF(skipper_rule) skipper_T;

template <typename Iterator, typename Skipper>
class Grammar1 : boost::spirit::qi::grammar<Iterator, Skipper>
under) >> *(qi::alnum ;


int main(int argc, char **argv)

Grammar1<string::const_iterator, skipper_T> g;
string input("input1.* input2.*");

g.parseInputFile(input.cbegin(), input.cend());




The important parts of the error message seem to be:



/usr/local/boost/include/boost/spirit/home/qi/nonterminal/rule.hpp:304:17:
error: no match for call to ‘(const function_type *REMOVED*)’
if (f(first, last, context, skipper))
^


The comment at line 304 in the above-mentioned Spirit file states that I
may be using an incompatible skipper, but I've tried the much simpler ascii::space_type skipper to no avail.



The rest of the error message:



usr/local/boost/include/boost/function/function_template.hpp:1048:7: note: 
candidate is:
class function<BOOST_FUNCTION_PARTIAL_SPEC>
^
/usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
boost::function4<R, T1, T2, T3, T4>:: *REMOVED*
result_type operator()(BOOST_FUNCTION_PARMS) const
^


/usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
no known conversion for argument 4 from ‘const
boost::spirit::unused_type’ to ‘const boost::spirit::qi::reference<const
boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
std::basic_string<char> > > >&’


Any idea what I am doing wrong? My compiler is gcc 4.8.5.










share|improve this question




























    0















    Compiling this simple Spirit grammar results in what seems to be a single error (despite the huge error message), possibly having to do with my skipper or some other template parameter that I have mistakenly used.



    I experimented with a variety of attribute definitions for the grammar and the start rule, but it had no effect on the error.



    #include <string>
    #include "/usr/local/boost/include/boost/spirit/include/qi.hpp"
    #include "/usr/local/boost/include/boost/spirit/include/qi_symbols.hpp"

    using std::string;

    namespace qi = boost::spirit::qi;
    namespace ascii = boost::spirit::ascii;

    boost::spirit::qi::rule<string::const_iterator>
    skipper_rule = qi::space | '#' >> *(qi::char_ - qi::eol) >> qi::eol;

    typedef BOOST_TYPEOF(skipper_rule) skipper_T;

    template <typename Iterator, typename Skipper>
    class Grammar1 : boost::spirit::qi::grammar<Iterator, Skipper>
    under) >> *(qi::alnum ;


    int main(int argc, char **argv)

    Grammar1<string::const_iterator, skipper_T> g;
    string input("input1.* input2.*");

    g.parseInputFile(input.cbegin(), input.cend());




    The important parts of the error message seem to be:



    /usr/local/boost/include/boost/spirit/home/qi/nonterminal/rule.hpp:304:17:
    error: no match for call to ‘(const function_type *REMOVED*)’
    if (f(first, last, context, skipper))
    ^


    The comment at line 304 in the above-mentioned Spirit file states that I
    may be using an incompatible skipper, but I've tried the much simpler ascii::space_type skipper to no avail.



    The rest of the error message:



    usr/local/boost/include/boost/function/function_template.hpp:1048:7: note: 
    candidate is:
    class function<BOOST_FUNCTION_PARTIAL_SPEC>
    ^
    /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
    boost::function4<R, T1, T2, T3, T4>:: *REMOVED*
    result_type operator()(BOOST_FUNCTION_PARMS) const
    ^


    /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
    no known conversion for argument 4 from ‘const
    boost::spirit::unused_type’ to ‘const boost::spirit::qi::reference<const
    boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
    std::basic_string<char> > > >&’


    Any idea what I am doing wrong? My compiler is gcc 4.8.5.










    share|improve this question
























      0












      0








      0








      Compiling this simple Spirit grammar results in what seems to be a single error (despite the huge error message), possibly having to do with my skipper or some other template parameter that I have mistakenly used.



      I experimented with a variety of attribute definitions for the grammar and the start rule, but it had no effect on the error.



      #include <string>
      #include "/usr/local/boost/include/boost/spirit/include/qi.hpp"
      #include "/usr/local/boost/include/boost/spirit/include/qi_symbols.hpp"

      using std::string;

      namespace qi = boost::spirit::qi;
      namespace ascii = boost::spirit::ascii;

      boost::spirit::qi::rule<string::const_iterator>
      skipper_rule = qi::space | '#' >> *(qi::char_ - qi::eol) >> qi::eol;

      typedef BOOST_TYPEOF(skipper_rule) skipper_T;

      template <typename Iterator, typename Skipper>
      class Grammar1 : boost::spirit::qi::grammar<Iterator, Skipper>
      under) >> *(qi::alnum ;


      int main(int argc, char **argv)

      Grammar1<string::const_iterator, skipper_T> g;
      string input("input1.* input2.*");

      g.parseInputFile(input.cbegin(), input.cend());




      The important parts of the error message seem to be:



      /usr/local/boost/include/boost/spirit/home/qi/nonterminal/rule.hpp:304:17:
      error: no match for call to ‘(const function_type *REMOVED*)’
      if (f(first, last, context, skipper))
      ^


      The comment at line 304 in the above-mentioned Spirit file states that I
      may be using an incompatible skipper, but I've tried the much simpler ascii::space_type skipper to no avail.



      The rest of the error message:



      usr/local/boost/include/boost/function/function_template.hpp:1048:7: note: 
      candidate is:
      class function<BOOST_FUNCTION_PARTIAL_SPEC>
      ^
      /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
      boost::function4<R, T1, T2, T3, T4>:: *REMOVED*
      result_type operator()(BOOST_FUNCTION_PARMS) const
      ^


      /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
      no known conversion for argument 4 from ‘const
      boost::spirit::unused_type’ to ‘const boost::spirit::qi::reference<const
      boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
      std::basic_string<char> > > >&’


      Any idea what I am doing wrong? My compiler is gcc 4.8.5.










      share|improve this question














      Compiling this simple Spirit grammar results in what seems to be a single error (despite the huge error message), possibly having to do with my skipper or some other template parameter that I have mistakenly used.



      I experimented with a variety of attribute definitions for the grammar and the start rule, but it had no effect on the error.



      #include <string>
      #include "/usr/local/boost/include/boost/spirit/include/qi.hpp"
      #include "/usr/local/boost/include/boost/spirit/include/qi_symbols.hpp"

      using std::string;

      namespace qi = boost::spirit::qi;
      namespace ascii = boost::spirit::ascii;

      boost::spirit::qi::rule<string::const_iterator>
      skipper_rule = qi::space | '#' >> *(qi::char_ - qi::eol) >> qi::eol;

      typedef BOOST_TYPEOF(skipper_rule) skipper_T;

      template <typename Iterator, typename Skipper>
      class Grammar1 : boost::spirit::qi::grammar<Iterator, Skipper>
      under) >> *(qi::alnum ;


      int main(int argc, char **argv)

      Grammar1<string::const_iterator, skipper_T> g;
      string input("input1.* input2.*");

      g.parseInputFile(input.cbegin(), input.cend());




      The important parts of the error message seem to be:



      /usr/local/boost/include/boost/spirit/home/qi/nonterminal/rule.hpp:304:17:
      error: no match for call to ‘(const function_type *REMOVED*)’
      if (f(first, last, context, skipper))
      ^


      The comment at line 304 in the above-mentioned Spirit file states that I
      may be using an incompatible skipper, but I've tried the much simpler ascii::space_type skipper to no avail.



      The rest of the error message:



      usr/local/boost/include/boost/function/function_template.hpp:1048:7: note: 
      candidate is:
      class function<BOOST_FUNCTION_PARTIAL_SPEC>
      ^
      /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
      boost::function4<R, T1, T2, T3, T4>:: *REMOVED*
      result_type operator()(BOOST_FUNCTION_PARMS) const
      ^


      /usr/local/boost/include/boost/function/function_template.hpp:758:17: note:
      no known conversion for argument 4 from ‘const
      boost::spirit::unused_type’ to ‘const boost::spirit::qi::reference<const
      boost::spirit::qi::rule<__gnu_cxx::__normal_iterator<const char*,
      std::basic_string<char> > > >&’


      Any idea what I am doing wrong? My compiler is gcc 4.8.5.







      c++ parsing compiler-errors boost-spirit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 22 at 22:11









      KurtKurt

      31




      31






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You are trying to use rule_nil_T rule which has skipper inside rule_str_T rule which does not. For internal reasons Spirit can only lose skipper when calling a rule. The problem can be easily solved by inlining under, dot, and star at use site.



          Note: a rule call in Qi has an overhead. Creating a rule for such a simple parser and then using it inside repeating parser is not a good idea.



          Hint: you can utilize raw directive and use literal parsers inside it to get more performant and cleaner to look parser. Consider this: qi::lexeme[qi::raw[(qi::alpha | '_') >> qi::alnum % '.'] >> ".*"].






          share|improve this answer























          • That fixed it. Thanks!

            – Kurt
            Mar 28 at 15:27











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55308433%2fspirit-grammar-wont-compile-function-template-argument-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You are trying to use rule_nil_T rule which has skipper inside rule_str_T rule which does not. For internal reasons Spirit can only lose skipper when calling a rule. The problem can be easily solved by inlining under, dot, and star at use site.



          Note: a rule call in Qi has an overhead. Creating a rule for such a simple parser and then using it inside repeating parser is not a good idea.



          Hint: you can utilize raw directive and use literal parsers inside it to get more performant and cleaner to look parser. Consider this: qi::lexeme[qi::raw[(qi::alpha | '_') >> qi::alnum % '.'] >> ".*"].






          share|improve this answer























          • That fixed it. Thanks!

            – Kurt
            Mar 28 at 15:27















          1














          You are trying to use rule_nil_T rule which has skipper inside rule_str_T rule which does not. For internal reasons Spirit can only lose skipper when calling a rule. The problem can be easily solved by inlining under, dot, and star at use site.



          Note: a rule call in Qi has an overhead. Creating a rule for such a simple parser and then using it inside repeating parser is not a good idea.



          Hint: you can utilize raw directive and use literal parsers inside it to get more performant and cleaner to look parser. Consider this: qi::lexeme[qi::raw[(qi::alpha | '_') >> qi::alnum % '.'] >> ".*"].






          share|improve this answer























          • That fixed it. Thanks!

            – Kurt
            Mar 28 at 15:27













          1












          1








          1







          You are trying to use rule_nil_T rule which has skipper inside rule_str_T rule which does not. For internal reasons Spirit can only lose skipper when calling a rule. The problem can be easily solved by inlining under, dot, and star at use site.



          Note: a rule call in Qi has an overhead. Creating a rule for such a simple parser and then using it inside repeating parser is not a good idea.



          Hint: you can utilize raw directive and use literal parsers inside it to get more performant and cleaner to look parser. Consider this: qi::lexeme[qi::raw[(qi::alpha | '_') >> qi::alnum % '.'] >> ".*"].






          share|improve this answer













          You are trying to use rule_nil_T rule which has skipper inside rule_str_T rule which does not. For internal reasons Spirit can only lose skipper when calling a rule. The problem can be easily solved by inlining under, dot, and star at use site.



          Note: a rule call in Qi has an overhead. Creating a rule for such a simple parser and then using it inside repeating parser is not a good idea.



          Hint: you can utilize raw directive and use literal parsers inside it to get more performant and cleaner to look parser. Consider this: qi::lexeme[qi::raw[(qi::alpha | '_') >> qi::alnum % '.'] >> ".*"].







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 12:07









          Nikita KniazevNikita Kniazev

          2,4702923




          2,4702923












          • That fixed it. Thanks!

            – Kurt
            Mar 28 at 15:27

















          • That fixed it. Thanks!

            – Kurt
            Mar 28 at 15:27
















          That fixed it. Thanks!

          – Kurt
          Mar 28 at 15:27





          That fixed it. Thanks!

          – Kurt
          Mar 28 at 15:27



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55308433%2fspirit-grammar-wont-compile-function-template-argument-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴