From 417682883e310d4d1122462610f584a91b43f777 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 27 Mar 2013 18:42:38 +0100 Subject: [PATCH] use only one constructor with a default parameter for units --- src/units.hh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/units.hh b/src/units.hh index 8f749b9f..652b66ab 100644 --- a/src/units.hh +++ b/src/units.hh @@ -84,8 +84,7 @@ private: struct LineCount : public StronglyTypedNumber { - LineCount() : LineCount(0) {} - constexpr LineCount(int value) : StronglyTypedNumber(value) {} + constexpr LineCount(int value = 0) : StronglyTypedNumber(value) {} }; inline constexpr LineCount operator"" _line(unsigned long long int value) @@ -95,8 +94,7 @@ inline constexpr LineCount operator"" _line(unsigned long long int value) struct ByteCount : public StronglyTypedNumber { - ByteCount() : ByteCount(0) {} - constexpr ByteCount(int value) : StronglyTypedNumber(value) {} + constexpr ByteCount(int value = 0) : StronglyTypedNumber(value) {} }; inline constexpr ByteCount operator"" _byte(unsigned long long int value) @@ -106,8 +104,7 @@ inline constexpr ByteCount operator"" _byte(unsigned long long int value) struct CharCount : public StronglyTypedNumber { - CharCount() : CharCount(0) {} - constexpr CharCount(int value) : StronglyTypedNumber(value) {} + constexpr CharCount(int value = 0) : StronglyTypedNumber(value) {} }; inline constexpr CharCount operator"" _char(unsigned long long int value) @@ -118,4 +115,3 @@ inline constexpr CharCount operator"" _char(unsigned long long int value) } #endif // units_hh_INCLUDED -