Remove iostream dependency
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- performance
调研方向
从 parser.hpp 开始,重点关注 detail::print_parser() 和 parser.call(),issue 在这里指出了 std::ostream 和 std::stringstream 的使用。将现有的错误报告路径与基于 printf() 的示例以及报告的静态可执行文件大小进行比较。当移除 iostream 依赖,或使其可自定义,同时不丢失所请求的错误报告行为时,即可视为完成。
由索引模型根据 Issue 内容生成。
描述
The current implementation uses std::ostream in detail::print_parser() and std::stringstream in parser.call() for error reporing. For static linked executables this brings in the whole locale mashinary of STL. Something not always desirable. I suggest replacing it or at least make it customizable whether to use iostreams or not.
I have made two examples with such a parser using printf() for error reporting:
lit('{') > int_ > lit(',') > int_ > lit('}')
Boost Spirit X3 results in a 154 KiB executable and Boost Parser in 218 KiB with error reporting removed in parser.hpp and 963 KiB with error reporting included.
Both compiled with GCC 15.1 for MinGW-W64 using -O2 -ffunction-sections -fdata-sections -s -static -Wl,--gc-sections. LTO makes hardly any difference here.
- 主要语言
- C++
- 星标
- 182
- 派生
- 28
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/parser 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 82/100
-
难度 1/5 1 小时以内 新手友好度 20/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
good first issue
难度 2/5 1-3 小时 新手友好度 75/100
ros2/message_filters#338 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
subsurface/subsurface#4984 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·