Explorar o código

Adding arithmetic for dimensioned types where multiplication and division should be restricted.

Sam Jaffe %!s(int64=7) %!d(string=hai) anos
pai
achega
cdb47e181c
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      opaque_typedef.hpp

+ 4 - 1
opaque_typedef.hpp

@@ -113,7 +113,10 @@ OPAQUE_TYPE_ASSIGN_OPERATOR(exclusive_or, ^);
 #undef OPAQUE_TYPE_ASSIGN_OPERATOR
 
 template <typename TDef>
-struct numeric_arithmetic : unary_plus<TDef>, unary_minus<TDef>, addition<TDef>, subtraction<TDef>, multiplication<TDef>, division<TDef> {};
+struct dimensional_arithmetic : unary_plus<TDef>, unary_minus<TDef>, addition<TDef>, subtraction<TDef> {};
+
+template <typename TDef>
+struct numeric_arithmetic : dimensional_arithmetic<TDef>, multiplication<TDef>, division<TDef> {};
 
 template <typename TDef>
 struct integer_arithmetic : numeric_arithmetic<TDef>, modulo<TDef> {};