Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:45:37+00:00 2026-05-24T06:45:37+00:00

What i think is that there is a bug in the boost token ids.

  • 0

What i think is that there is a bug in the boost token ids. But I’m not sure.
The boost token iterators are not able to detect the T_CONTLINE token which is ‘\ \’ followed by ‘\n’ See: http://www.boost.org/doc/libs/1_46_1/libs/wave/doc/token_ids.html

For the sample test, I have a test file: testfile.h

  1 #define Funtion(x) X + \
  2                       Y
  3 
  4 #define MYVAR 100+\
  5               200

And here is the program which looks for the T_CONTLINE

  1 #include <iostream>
  2 #include <fstream>
  3 
  4 #include <boost/wave/cpplexer/cpp_lex_token.hpp>
  5 #include <boost/wave/cpplexer/cpp_lex_iterator.hpp>
  6 
  7 typedef boost::wave::cpplexer::lex_token<> token_type;
  8 typedef boost::wave::cpplexer::lex_iterator<token_type> token_iterator;
  9 typedef token_type::position_type position_type;
 10 
 11 int main()
 12 {
 13   const char* infile = "testfile.h";
 14   std::string instr;
 15   std::ifstream gmstream(infile);
 16   if(!gmstream.is_open()) {
 17       std::cerr << "Could not open file: "<< infile<<"\n";
 18   }
 19   gmstream.unsetf(std::ios::skipws);
 20   instr = std::string(std::istreambuf_iterator<char>(gmstream.rdbuf()),
 21       std::istreambuf_iterator<char>());
 22 
 23   position_type pos(infile);
 24   token_iterator  it = token_iterator(instr.begin(), instr.end(), pos,
 25       boost::wave::language_support(
 26         boost::wave::support_cpp|boost::wave::support_option_long_long));
 27   token_iterator end = token_iterator();
 28 
 29   boost::wave::token_id id = *it;
 30 
 31   while(it!=end) {
 32     if(id == boost::wave::T_CONTLINE) {
 33       std::cout<<"Found Contline";
 34     }
 35     ++it;
 36     id = *it;
 37   }
 38 return 0;
 39 }

But I don’t get any output.

I’m using boost_1_47_1, and gcc-4.5

EDIT:
Actually there was a similar bug-report posted here:

https://svn.boost.org/trac/boost/ticket/5569

See the changelog: http://www.boost.org/doc/libs/1_47_0/libs/wave/ChangeLog

This bug is reported to be solved with the latest boost 1.47.0 So i installed the latest boost 1.47.0 but still the problem remains.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:45:38+00:00Added an answer on May 24, 2026 at 6:45 am

    Yes, this token is not exposed on the iterator level, it is just handled internally very early in the processing. It’s not a bug, but expected behavior. I will add a note to the documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across an issue that makes me think there is bug in the
This seems like a bug in Rails to me, but there's probably not much
Maybe there is something obvious I cannot see but I think that setting data-theme
After messing about with F# there are some really nice features that I think
This is something that I think would be very useful. Basically, I'd like there
I think there must be something subtle going on here that I don't know
There is one thing that I do not understand... Imagine you have a text
I am using vsvim and I think that it is a great tool. But
I found a threadpool which doesn't seem to be in boost yet, but I
I need to empty the data on a socket (making sure that there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.