From 561cc72d6cdeaea4c7a448780973923ea1d78f1b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 Oct 2012 00:13:31 +0200 Subject: [PATCH] Add a ByteCount unit --- src/units.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/units.hh b/src/units.hh index d4988ccf..74840402 100644 --- a/src/units.hh +++ b/src/units.hh @@ -86,6 +86,16 @@ inline constexpr LineCount operator"" _line(unsigned long long int value) return LineCount(value); } +struct ByteCount : public StronglyTypedInteger +{ + constexpr ByteCount(int value) : StronglyTypedInteger(value) {} +}; + +inline constexpr ByteCount operator"" _byte(unsigned long long int value) +{ + return ByteCount(value); +} + struct CharCount : public StronglyTypedInteger { constexpr CharCount(int value) : StronglyTypedInteger(value) {}