Project

General

Profile

Actions

Feature #101

closed

Conversion of pointer parameters into references

Added by Markus Elfring almost 14 years ago. Updated over 13 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

This issue corresponds to my previous feature request.

I suggest to convert a parameter like "in", "cap" and "con" from a pointer to a reference.
source:src/client/Client.h@bc32b8f7639eec144404bbc61cb59be5dd1f04a3#L1083

Can such an interface design adjustment be applied on other places in the source code, too?

Actions #1

Updated by Sage Weil almost 14 years ago

  • Status changed from New to Rejected

Markus Elfring wrote:

This issue corresponds to my previous feature request.

I suggest to convert a parameter like "in", "cap" and "con" from a pointer to a reference.
source:src/client/Client.h@bc32b8f7639eec144404bbc61cb59be5dd1f04a3#L1083

Can such an interface design adjustment be applied on other places in the source code, too?

I'd prefer to leave these as pointers because they are already allocated on the heap and because it makes the pass-by-reference more explicit.

Actions #2

Updated by Markus Elfring almost 14 years ago

... and because it makes the pass-by-reference more explicit.

I find this opinion questionable. I assume that you consider a C coding style interface here instead of C++.

I would like to clarify where null pointers are really valid input parameters for (member) functions.

Actions

Also available in: Atom PDF