What is the right term to return something as an out parameter?

Hope this question is on topic.

I did a code review and came across the following function:

bool SomeFunc(std::string& o_xxx, char& o_yyy); 

This function is used to extract the xxx and yyy values โ€‹โ€‹of a certain class using the out parameters.

Comments (which are later used for automatic documentation) say:

... this function returns by reference [xxx] and [yyy] ...

Obviously, the function returns a boolean indicating success or failure. Therefore, the above sentence needs to be rephrased. But how? What is the correct term (if any) for returning something, as it were, using the output parameter or, in other words, filling in the argument passed by the link?

The question is related to the agnostic of the language, since it is not C ++ specific. But he also noted C ++, because the example is in C ++.

+7
source share
4 answers

"After success, SomeFunc stores in o_xxx and o_yyy values โ€‹โ€‹..."; stored in how the man Linux man page strtoul(3) describes what this function does with the endptr argument.

Although I also heard the phrase "return to" quite often with the options listed here.

+8
source

In simplest words:

The SomeFunc() function can change the parameters xxx(std::string) and yyy(char) and return success or failure ( bool ).

+1
source

Consider the MSDN method. An example .

The return value is described in its own section.
The manipulations with the output parameters are described in their own sections and may optionally be repeated in the "Return Value" section.

+1
source

If you use doxygen then this will do:

 /** *- Description : This function ... * * @param[out] xxx ... * @param[out] yyy ... * * @return true for ..., false otherwise * ***********************************************************************/ 
+1
source

All Articles