Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`basic_pbf_builder<TBuffer, T>` submessage constructor does not enforce correct parent tag type.

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

issue に示されている basic_pbf_builder サブメッセージコンストラクターから始め、関連する basic_pbf_writer、pbf_tag_type、および tag-type 定義を調べてください。parent と tag の型がどのように表現されているかを確認し、正しい構築が引き続き可能であることと、誤った parent tag 型がコンパイル時に拒否されることを示すカバレッジを追加してください。

索引モデルが issue の本文から書いたものです。

説明

This constructor of basic_pbf_builder:

    /**
     * Construct a pbf_builder for a submessage from the pbf_message or
     * pbf_writer of the parent message.
     *
     * @param parent_writer The parent pbf_message or pbf_writer
     * @param tag Tag of the field that will be written
     */
    template <typename P>
    basic_pbf_builder(basic_pbf_writer<TBuffer>& parent_writer, P tag) :
        basic_pbf_writer<TBuffer>{parent_writer, pbf_tag_type(tag)} {
    }

Does not enforce that P is the correct tag type of parent_writer.

Would it be acceptable to submit a PR that replaces or overloads this constructor with:

    /**
     * Construct a pbf_builder for a submessage from the pbf_builder of the parent message.
     *
     * @param parent_writer The parent pbf_builder
     * @param tag Tag of the field that will be written
     */
    template <typename P>
    basic_pbf_builder(basic_pbf_builder<TBuffer, P>& parent_builder, P tag) :
        basic_pbf_writer<TBuffer>{parent_builder, pbf_tag_type(tag)} {
    }

I did not verify that this compiles, but I think it explains the idea.

主要言語
C++
スター
381
フォーク
83
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mapbox/protozero のほかの issue

mapbox/protozero の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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