From 11808561cb9e44392b5e0605c270854a8c21ff29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Joly?= Date: Thu, 19 Dec 2024 11:29:31 +0100 Subject: [PATCH] Add link to S6023 --- rules/S7172/cfamily/rule.adoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rules/S7172/cfamily/rule.adoc b/rules/S7172/cfamily/rule.adoc index 0ef3efe935c..286b411e04e 100644 --- a/rules/S7172/cfamily/rule.adoc +++ b/rules/S7172/cfamily/rule.adoc @@ -90,7 +90,7 @@ void perform(Node node, optional recursive, Action action) { } ---- -In this simple case, the use of both `recursive` and `++*recursive++` hints that recursive is more than a simple `bool`. However, it is possible to write the code with a higher level semantic: +In this simple case, the use of both `recursive` and `++*recursive++` hints that recursive is more than a simple `bool`. However, it is possible to write the code with a higher level semantic (see S6023): [source,cpp] ---- @@ -117,6 +117,11 @@ void perform(optional recursive) { This syntax is more complex, but it is also more flexible, especially when chaining operations on `optional` or `expected` values. == Resources + +=== Related rules + +* S6023 - "std::optional" member function "value_or" should be used + === Documentation * {cpp} reference - https://en.cppreference.com/w/cpp/utility/optional[`std::optional`]