Procházet zdrojové kódy

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

Sam Jaffe před 7 roky
rodič
revize
cdb47e181c
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  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> {};