This commit is contained in:
Laurent Perron
2023-12-21 14:33:16 +01:00
parent d549f6d145
commit ef9986c18b
2 changed files with 16 additions and 16 deletions

View File

@@ -247,14 +247,14 @@ class IntType {
// -- ASSIGNMENT OPERATORS ---------------------------------------------------
// We support the following assignment operators: =, +=, -=, *=, /=, <<=, >>=
// and %= for both ThisType and ValueType.
#define INT_TYPE_ASSIGNMENT_OP(op) \
ThisType& operator op(const ThisType& arg_value) { \
value_ op arg_value.value(); \
return *this; \
} \
ThisType& operator op(ValueType arg_value) { \
value_ op arg_value; \
return *this; \
#define INT_TYPE_ASSIGNMENT_OP(op) \
ThisType& operator op(const ThisType & arg_value) { \
value_ op arg_value.value(); \
return *this; \
} \
ThisType& operator op(ValueType arg_value) { \
value_ op arg_value; \
return *this; \
}
INT_TYPE_ASSIGNMENT_OP(+=);
INT_TYPE_ASSIGNMENT_OP(-=);

View File

@@ -258,14 +258,14 @@ class StrongInt {
// -- ASSIGNMENT OPERATORS ---------------------------------------------------
// We support the following assignment operators: =, +=, -=, *=, /=, <<=, >>=
// and %= for both ThisType and ValueType.
#define STRONG_INT_TYPE_ASSIGNMENT_OP(op) \
ThisType& operator op(const ThisType& arg_value) { \
value_ op arg_value.value(); \
return *this; \
} \
ThisType& operator op(ValueType arg_value) { \
value_ op arg_value; \
return *this; \
#define STRONG_INT_TYPE_ASSIGNMENT_OP(op) \
ThisType& operator op(const ThisType & arg_value) { \
value_ op arg_value.value(); \
return *this; \
} \
ThisType& operator op(ValueType arg_value) { \
value_ op arg_value; \
return *this; \
}
STRONG_INT_TYPE_ASSIGNMENT_OP(+=);
STRONG_INT_TYPE_ASSIGNMENT_OP(-=);