jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
5.09k stars 1.83k forks source link

YAML::convert<>::decode argument name rhs is confusing #1156

Open klenze opened 1 year ago

klenze commented 1 year ago

In the tutorial, the example of YAML::convert<> defines a method static bool decode(const Node& node, Vec3& rhs) .

From my understanding, the variable name rhs is commonly used for the right hand side of a binary operator during operator overloading (e.g. for operator/, operator=, operator== etc), which is often (typically unless rvalue ref in operator= (?)) a read-only input argument to the operator.

While "rhs" is a valid variable name, using it for something which is the output of a method is (to me) somewhat confusing. I propose renaming it res or out in all instances of decode, in the tutorial and convert.h.

jbeder commented 1 year ago

Sounds good, feel free to submit a PR.