[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 7dbe4fb 1/5: Explain why 'C0' is kept even th
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 7dbe4fb 1/5: Explain why 'C0' is kept even though '0_cents' is available |
Date: |
Tue, 11 May 2021 12:03:51 -0400 (EDT) |
branch: master
commit 7dbe4fbf8095763e481120168ce0d1aa91740704
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Explain why 'C0' is kept even though '0_cents' is available
---
currency.hpp | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/currency.hpp b/currency.hpp
index 8a6ce9f..d2c6e2b 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -145,13 +145,10 @@ inline std::vector<double> dblize(std::vector<currency>
const& z)
return r;
}
-/// Zero cents--akin to a user-defined literal.
+/// Zero cents as a terse compile-time constant.
///
-/// UDLs seem less convenient because the obvious "0_c" is likely to
-/// collide with some other UDL, and "currency::0_c" is too verbose.
-/// "0_cents" may avoid both those problems, but "C0" is terser.
-/// "C0" is chosen instead of "c0" only for the pixilated reason that
-/// the capital letter looks kind of like a "0".
+/// This particular value occurs so often that it merits a name
+/// no wider than '0.0' (unlike the equivalent '0_cents').
inline constexpr currency C0 = {};