I hope this question is on topic.
I was doing code review and stumbled upon the following function:
bool SomeFunc(std::string& o_xxx, char& o_yyy);
This function is used to retrieve the values of xxx
and yyy
of some class by means of out parameters.
The comments (which are later used for auto-documentation) say:
... this function returns by reference the [xxx] and [yyy]...
Obviously the function returns a boolean value indicating success or failure. So the sentence above need to be rephrased. But how? What's the correct term (if any) for returning something, as it were, by means of an out parameter, or, in other words, populating an argument passed by reference?
The question is tagged language agnostic, because it's not C++ specific. But it's also tagged C++ because the example is in C++.
"Upon success,
SomeFunc
stores ino_xxx
ando_yyy
the values ..."; stores in is how the Linux manpagestrtoul(3)
describes what that function does with itsendptr
argument.Though I've also heard the phrase "return in" often enough with reference-typed out parameters.