diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-10-11 00:13:31 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-10-11 00:13:31 +0200 |
| commit | 561cc72d6cdeaea4c7a448780973923ea1d78f1b (patch) | |
| tree | f063cf6fdefdd2bb959a174cb02c7f1cfc177340 /src | |
| parent | 2cdebe01d3e2aff0bbf236a72ea3ff0f21f592ee (diff) | |
Add a ByteCount unit
Diffstat (limited to 'src')
| -rw-r--r-- | src/units.hh | 10 |
1 files changed, 10 insertions, 0 deletions
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<ByteCount, int> +{ + constexpr ByteCount(int value) : StronglyTypedInteger<ByteCount>(value) {} +}; + +inline constexpr ByteCount operator"" _byte(unsigned long long int value) +{ + return ByteCount(value); +} + struct CharCount : public StronglyTypedInteger<CharCount, int> { constexpr CharCount(int value) : StronglyTypedInteger<CharCount>(value) {} |
