|
Boost : |
From: Maciej Sobczak (prog_at_[hidden])
Date: 2006-06-08 06:18:42
Hi,
In the Quickstart page of the Wave docs there is an example:
typedef wave::context<std::string::iterator,
wave::cpplexer::lex_token<> >
context_t;
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
boost::wave::cpplexer::lex_token<boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<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(
std::istreambuf_iterator<char>(file.rdbuf()),
std::istreambuf_iterator<char>());
typedef boost::wave::context<std::string::iterator,
boost::wave::cpplexer::lex_token<> > context_t;
context_t ctx(input.begin(), input.end(), "wavetest.cpp");
}
Regards,
-- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk