Modify rule S6487: LaYC format

This commit is contained in:
Marco Borgeaud 2023-07-11 13:32:20 +02:00 committed by GitHub
parent 36d95e483f
commit 39009f48d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,15 +26,15 @@ This rule raises an issue when:
[source,cpp,diff-id=1,diff-type=noncompliant]
----
std::cout << std::format("{} {}", 1, 2, sqrt(2)); // Noncompliant
std::cout << std::format("{0} {0} {2}", 1, 2, 3); // Noncompliant
std::cout << std::format("{} {}", 1, 2, sqrt(2));
std::cout << std::format("{0} {0} {2}", 1, 2, 3);
----
==== Compliant solution
[source,cpp,diff-id=1,diff-type=compliant]
----
std::cout << std::format("{} {} {}", 1, 2, sqrt(2)); // Compliant
std::cout << std::format("{0} {0} {2} {1}", 1, 2, 3); // Compliant
std::cout << std::format("{} {} {}", 1, 2, sqrt(2));
std::cout << std::format("{0} {0} {2} {1}", 1, 2, 3);
----
== Resources