New function as alternative to `operator[]` for read and write
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C++
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 22h 2m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jbeder/yaml-cpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
Difficulty 3/5 Half a day Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/microsoft-ui-xaml#12515 · 1 comment · 1 reaction ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
FujiNetWIFI/fujinet-firmware#2261 ·
Maintainers usually reply within 1 day
-
bug difficulty: easy good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nagisa-kamishiro/rosehip#73 ·
Maintainers usually reply within 1 day
-
bazel bug odb
Difficulty 1/5 Under an hour Newbie friendliness 80/100
The-OpenROAD-Project/OpenROAD#12095 · 1 comment ·
Maintainers usually reply within 1 day