Boost logo

Boost :

From: Maciej Sobczak (prog_at_[hidden])
Date: 2006-06-08 06:18:42


In the Quickstart page of the Wave docs there is an example:

typedef wave::context<std::string::iterator,
             wave::cpplexer::lex_token<> >

Above, the context type gets the lex_token<> as a second parameter.
The problem is that inside the context type (cpp_context.hpp:75 in
boost-1.33.1) there is:

     typedef typename LexIteratorT::token_type token_type;

LexIteratorT is a second template parameter, which is lex_token in the
above example - and there is no token_type type defined in lex_token.
This results in the following compile-time error (g++ 3.2.3):

/local/include/boost_1_33_1/boost/wave/cpp_context.hpp:75: no type named `
    token_type' in `class
    std::char_traits<char>, std::allocator<char>,

    std::allocator<char> >, char*> > > >'

Am I missing something obvious?

The smallest code example with this problem is:

#include <boost/wave.hpp>
#include <boost/wave/cpplexer/cpp_lex_token.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <iterator>

int main()
      std::ifstream file("wavetest.cpp");
      std::string input(

      typedef boost::wave::context<std::string::iterator,
           boost::wave::cpplexer::lex_token<> > context_t;

      context_t ctx(input.begin(), input.end(), "wavetest.cpp");


Maciej Sobczak :
Programming    :

Boost list run by bdawes at, gregod at, cpdaniel at, john at