Remove iostream dependency

オープン
#241 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/parser のほかの issue

boostorg/parser の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。