Modify rule S6462: add diff view
This commit is contained in:
parent
aadcc931dc
commit
b9cf5c5103
@ -20,7 +20,7 @@ This rule raises an issue for generic iterator-pair algorithms that are not cons
|
||||
|
||||
=== Noncompliant code example
|
||||
|
||||
[source,cpp]
|
||||
[source,cpp,diff-id=1,diff-type=noncompliant]
|
||||
----
|
||||
template<typename Iter, typename Func>
|
||||
void adjacent_for_each(Iter first, Iter last, Func func) {
|
||||
@ -34,10 +34,10 @@ void adjacent_for_each(Iter first, Iter last, Func func) {
|
||||
|
||||
=== Compliant solution
|
||||
|
||||
[source,cpp]
|
||||
[source,cpp,diff-id=1,diff-type=compliant]
|
||||
----
|
||||
template<std::forward_iterator Iter, typename Func>
|
||||
// compliant, even though this template needs additional operations, for instance:
|
||||
// Compliant, even though this template needs additional operations, for instance:
|
||||
// requires std::invocable<Func&, std::iter_reference_t<Iter>, std::iter_reference_t<Iter>>
|
||||
void adjacent_for_each(Iter first, Iter last, Func func) {
|
||||
auto prev = first;
|
||||
|
Loading…
x
Reference in New Issue
Block a user