Commit 643c7bab by Devin Jeanpierre Committed by Copybara-Service

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
parent fbd5fa17
......@@ -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_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment