From 8a0053d671c2e187efa525d63d4ff086cc1619c6 Mon Sep 17 00:00:00 2001 From: Bill Rose Date: Thu, 13 May 2021 14:30:53 -0400 Subject: [PATCH] Update change_speed example in P.1 to use user-defined literal syntax (#1778) Co-authored-by: Bill Rose --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index e2afd5f..12d0250 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -551,7 +551,7 @@ A better approach is to be explicit about the meaning of the double (new speed o change_speed(Speed s); // better: the meaning of s is specified // ... change_speed(2.3); // error: no unit - change_speed(23m / 10s); // meters per second + change_speed(23_m / 10s); // meters per second We could have accepted a plain (unit-less) `double` as a delta, but that would have been error-prone. If we wanted both absolute speed and deltas, we would have defined a `Delta` type.