- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我认为 boost token ID 中存在错误。但我不确定。boost token 迭代器无法检测到 T_CONTLINE
token ,即“\\”后跟“\n”,请参阅:http://www.boost.org/doc/libs/1_46_1/libs/wave/doc/token_ids.html
为了示例测试,我有一个测试文件:testfile.h
1 #define Funtion(x) X + \
2 Y
3
4 #define MYVAR 100+\
5 200
这是寻找 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 }
但是我没有得到任何输出。
我正在使用 boost_1_47_1 和 gcc-4.5
编辑:实际上这里有一个类似的错误报告:
https://svn.boost.org/trac/boost/ticket/5569
查看更新日志:http://www.boost.org/doc/libs/1_47_0/libs/wave/ChangeLog
据报道,此错误已通过最新的 boost 1.47.0 解决,所以我安装了最新的 boost 1.47.0,但问题仍然存在。
最佳答案
是的,这个 token 并没有暴露在迭代器级别,它只是在处理的很早的时候在内部处理。这不是错误,而是预期的行为。我将在文档中添加注释。
关于c++ - boost T_CONTLINE token 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6892272/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!