diff options
author | Devin Jeanpierre <jeanpierreda@google.com> | 2024-04-02 16:53:10 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-02 16:53:58 -0700 |
commit | 643c7bab4994d720125fb30e8fb3a10e99bcbb47 (patch) | |
tree | 914c28949d2ca1155009e720f4c7a00cb682c24e /absl/time | |
parent | fbd5fa1781ce6151770557a90d018f71e64e45d0 (diff) | |
download | abseil-643c7bab4994d720125fb30e8fb3a10e99bcbb47.tar.gz abseil-643c7bab4994d720125fb30e8fb3a10e99bcbb47.tar.bz2 abseil-643c7bab4994d720125fb30e8fb3a10e99bcbb47.zip |
Use _decimal_ literals for the CivilDay example.
Using `07` is a neat pun, but it not friendly to the reader. If the reader naively copies it and then changes the `7` to an `8` or a `9`, it will fail compilation: `invalid digit ... in octal constant`. Best avoided. Note that the other examples do not use octal literals.
PiperOrigin-RevId: 621335289
Change-Id: I6b11a639c5ba675eb29467baf45996ceff0ed9bf
Diffstat (limited to 'absl/time')
-rw-r--r-- | absl/time/civil_time.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/time/civil_time.h b/absl/time/civil_time.h index 3e904a11..d198ebae 100644 --- a/absl/time/civil_time.h +++ b/absl/time/civil_time.h @@ -55,7 +55,7 @@ // Example: // // // Construct a civil-time object for a specific day -// const absl::CivilDay cd(1969, 07, 20); +// const absl::CivilDay cd(1969, 7, 20); // // // Construct a civil-time object for a specific second // const absl::CivilSecond cd(2018, 8, 1, 12, 0, 1); @@ -65,7 +65,7 @@ // Example: // // // Valid in C++14 -// constexpr absl::CivilDay cd(1969, 07, 20); +// constexpr absl::CivilDay cd(1969, 7, 20); #ifndef ABSL_TIME_CIVIL_TIME_H_ #define ABSL_TIME_CIVIL_TIME_H_ |