Add a ByteCount unit

This commit is contained in:
Maxime Coste 2012-10-11 00:13:31 +02:00
parent 2cdebe01d3
commit 561cc72d6c

View File

@ -86,6 +86,16 @@ inline constexpr LineCount operator"" _line(unsigned long long int value)
return LineCount(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> struct CharCount : public StronglyTypedInteger<CharCount, int>
{ {
constexpr CharCount(int value) : StronglyTypedInteger<CharCount>(value) {} constexpr CharCount(int value) : StronglyTypedInteger<CharCount>(value) {}