Questions tagged [out-parameters]
The out-parameters tag has no summary.
6 questions
4 votes
2 answers
3k views
Should a method modifying object passed as a parameter return the modified object? [duplicate]
I have some incoming request - it's an instance of class generated from api specification - POJO with public getters/setters. I would like to normalize some values. For example dimensions (to use ...
15 votes
3 answers
11k views
non-optional pointers vs. non-const references in C++
In Other C++ Features, Reference Arguments of the Google C++ Style Guide, I read that non-const references must not be used. All parameters passed by reference must be labeled const. It is clear ...
8 votes
4 answers
12k views
Function that modifies an argument, should I return the modified object?
We have a function that modifies a JS object, by adding some custom properties to it. The function doesn't return antyhing addTransaction: function (obj) { obj.transactionId = this....