
## Review A dedicated reviewer checked the rule description successfully for: - [x] logical errors and incorrect information - [x] information gaps and missing content - [x] text style and tone - [x] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule) --------- Co-authored-by: Arseniy Zaostrovnykh <arseniy.zaostrovnykh@sonarsource.com>
15 lines
392 B
Plaintext
15 lines
392 B
Plaintext
In {cpp}, it is preferred to use reference parameters (`Type const&` or `Type&`), or pass objects by value (`Type`), instead of a pointer (`Type const*` or `Type*`), if the argument is expected to never be null.
|
|
|
|
[source,cpp]
|
|
----
|
|
// Precondition: graph != null
|
|
bool isDAG(Graph const* graph);
|
|
----
|
|
|
|
The preferred signature would be:
|
|
|
|
[source,cpp]
|
|
----
|
|
bool isDAG(Graph const& graph);
|
|
----
|