Go to the documentation of this file.00001 #ifndef VIENNAMATH_COMPILETIME_OPERATIONS_CT_CT_HPP
00002 #define VIENNAMATH_COMPILETIME_OPERATIONS_CT_CT_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <ostream>
00021 #include "viennamath/forwards.h"
00022 #include "viennamath/compiletime/ct_constant.hpp"
00023 #include "viennamath/compiletime/ct_variable.hpp"
00024 #include "viennamath/compiletime/ct_binary_expr.hpp"
00025
00030 namespace viennamath
00031 {
00032
00033 namespace result_of
00034 {
00036 template <typename LHS, typename RHS>
00037 struct add<LHS, RHS, true, true>
00038 {
00039 typedef ct_binary_expr<LHS,
00040 op_plus<default_numeric_type>,
00041 RHS > type;
00042
00043 static type instance(LHS const & lhs, RHS const & rhs) { return type(); }
00044 };
00045
00047 template <typename LHS, typename RHS>
00048 struct subtract<LHS, RHS, true, true>
00049 {
00050 typedef ct_binary_expr<LHS,
00051 op_minus<default_numeric_type>,
00052 RHS > type;
00053
00054 static type instance(LHS const & lhs, RHS const & rhs) { return type(); }
00055 };
00056
00058 template <typename LHS, typename RHS>
00059 struct mult<LHS, RHS, true, true>
00060 {
00061 typedef ct_binary_expr<LHS,
00062 op_mult<default_numeric_type>,
00063 RHS > type;
00064
00065 static type instance(LHS const & lhs, RHS const & rhs) { return type(); }
00066 };
00067
00069 template <typename LHS, typename RHS>
00070 struct div<LHS, RHS, true, true>
00071 {
00072 typedef ct_binary_expr<LHS,
00073 op_div<default_numeric_type>,
00074 RHS > type;
00075
00076 static type instance(LHS const & lhs, RHS const & rhs) { return type(); }
00077 };
00078
00079 }
00080
00081
00082
00083
00084 }
00085
00086 #endif