New function as alternative to `operator[]` for read and write

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp, yaml
領域
backend

調査の方向性

Start by reading the public Node API and its tests to see how operator[] handles both reads and writes, including missing keys and exceptions. Identify an alternative function that supports both operations and determine its expected behavior from the existing API. Done means the proposed API is clear and tested for reading and writing YAML nodes.

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

説明

Example:

YAML::Node node = YAML::LoadFile(constant::file::configuration);
const double commission_factor = node["factor"].as<double>();
node["factor"] = 4.532;

It would be beneficial to have an alternative function instead of the overloaded operator operator[] to please the clang-tidy recommendation to not use overloaded operator[], https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.html. This is needed for read and write operations.

This makes sense as in the STL operator[] does not throw exceptions but rather aborts the programme and thus is not recommended.

主要言語
C++
スター
6.1k
フォーク
2.2k
平均マージ
22時間 2分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

jbeder/yaml-cpp のほかの issue

jbeder/yaml-cpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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