Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Remove iostream dependency

未关闭
#241 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

boostorg/parser 的其他 Issue

查看 boostorg/parser 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。