[Boost-bugs] [Boost C++ Libraries] #3818: is_parser char_parser yet doesn't have operator[]

Subject: [Boost-bugs] [Boost C++ Libraries] #3818: is_parser char_parser yet doesn't have operator[]
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-04 20:50:04


#3818: is_parser char_parser yet doesn't have operator[]
---------------------------------------+------------------------------------
 Reporter: cppljevans@… | Owner:
     Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: None
  Version: Boost 1.41.0 | Severity: Problem
 Keywords: |
---------------------------------------+------------------------------------
 The template:

 template<typename TokType>
 struct toklit
 : qi::char_parser
   < toklit<TokType>
   , TokType
>
 {
       TokType
     my_tok_valu
     ;
     toklit( TokType const& a_tok_valu)
     : my_tok_valu(a_tok_valu)
     {}

     template<typename Context>
     bool test( TokType const& a_tok_valu, Context)const
     {
         return a_tok_valu == my_tok_valu;
     }

 };

 satisfies:

   traits::is_parser<toklit<char> >::type::value

 , and consequently, according to:

 http://www.boost.org/doc/libs/1_41_0/libs/spirit/doc/html/spirit/qi/reference/parser_concepts/parser.html

 is a parser. According to:

 http://www.boost.org/doc/libs/1_41_0/libs/spirit/doc/html/spirit/qi/tutorials/semantic_actions.html#spirit.qi.tutorials.semantic_actions.examples_of_semantic_actions

 and more specifically, the passage:

   Say you have a parser P, and a C++ function F. You can make the
   parser call F whenever it matches an input by attaching F:

     P[F]

 and instance, such as:

   toklit<char> px('x')

 should have an operator[] defined, but it doesn't, because
 the error message produced by the gcc4.4 compiler is:

   error: no match for 'operator[]' in 'px[client
     ::print_char]'

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3818>
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-02-16 18:50:02 UTC