Modify rule S6462: add diff view

This commit is contained in:
Amelie Renard 2023-09-21 15:11:49 +02:00 committed by Amélie Renard
parent aadcc931dc
commit b9cf5c5103

View File

@ -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;