yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

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

Open klenze opened this issue 3 years ago • 1 comments

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.

klenze avatar Nov 17 '22 16:11 klenze

Sounds good, feel free to submit a PR.

jbeder avatar Aug 10 '23 19:08 jbeder