
On 29.8.2011 12:07, Alexander Feldman wrote:
Hi,
I have (I suppose) a beginner problem -- cannot make wave + spirit compile. I think there is an iterator problem but I cannot understand the compiler error. I am attaching a small example and the error output - can somebody explain how to fix this? I have searched around a lot but can't find an answer to that.
Hi, you can't directly pass Wave iterators to Spirit (as you're doing now by passing Wave's pp_iterator< .. > [the context_type::iterator_type] to Spirit's phrase_parse.). The easiest way, I believe, is to simply iterate thru Wave's pp_iterator to generate a preprocessed string (so, instead of pushing your data to std::cout push it to std::stringstream etc.). After you've done that, pass that string to Spirit and it'll work. I guess you could write a ForwardIterator that would directly pass data from Wave to Spirit, but frankly speaking, I didn't even try that myself. Maybe try that after you've experimented with the Wave+Spirit combination a bit more? Br, Pekka