21 #ifndef RFFGEN_UTIL_ADDMISSINGOPERATORS_HH
22 #define RFFGEN_UTIL_ADDMISSINGOPERATORS_HH
24 #include <type_traits>
31 template <
class Arg ,
32 class = std::enable_if_t< !std::is_base_of<Base,Arg>() && !std::is_arithmetic<Arg>() > ,
33 class = std::enable_if_t< !Checks::summation<Arg>() &&
34 Checks::inPlaceSummation<Arg>() > >
35 auto operator+(Arg x, const Arg& y)
42 template <
class Arg ,
class ScalarArg ,
43 class = std::enable_if_t< std::is_arithmetic<ScalarArg>::value > ,
44 class = std::enable_if_t< !std::is_base_of<Base,Arg>() && !std::is_arithmetic<Arg>() > ,
45 class = std::enable_if_t< !Checks::multiplicationWithArithmeticFromLeft<Arg,ScalarArg>() &&
46 Checks::inPlaceMultiplicationWithArithmetic<Arg,ScalarArg>() > >
47 auto operator*( ScalarArg a , Arg x )
54 template <
class Arg ,
class ScalarArg ,
55 class = std::enable_if_t< std::is_arithmetic<ScalarArg>::value > ,
56 class = std::enable_if_t< !std::is_base_of<Base,Arg>() && !std::is_arithmetic<Arg>::value> ,
57 class = std::enable_if_t< !Checks::multiplicationWithArithmeticFromRight<Arg,ScalarArg>() &&
58 Checks::inPlaceMultiplicationWithArithmetic<Arg,ScalarArg>() > >
59 auto operator*( Arg x , ScalarArg a )
66 template <
class Arg1 ,
class Arg2 ,
67 class = std::enable_if_t< !std::is_base_of<Arg1,Base>() && !std::is_base_of<Arg2,Base>() > ,
68 class = std::enable_if_t< !std::is_arithmetic<Arg1>() && !std::is_arithmetic<Arg2>() > ,
69 class = std::enable_if_t< !Checks::multiplication<Arg1,Arg2>() &&
70 Checks::inPlaceMultiplication<Arg1,Arg2>() > >
71 auto operator*( Arg1 x, const Arg2& y)
78 template <
class Arg1 ,
class Arg2 ,
79 class = std::enable_if_t< !std::is_base_of<Arg1,Base>() && !std::is_base_of<Arg2,Base>() > ,
80 class = std::enable_if_t< !std::is_arithmetic<Arg1>() && !std::is_arithmetic<Arg2>() > ,
81 class = std::enable_if_t< !Checks::multiplication<Arg1,Arg2>() &&
82 !Checks::inPlaceMultiplication<Arg1,Arg2>() > ,
83 class = std::enable_if_t< Checks::callToRightMultiply<Arg1,Arg2>() > >
84 auto operator*( Arg1 x , const Arg2& y)
86 return x.rightmultiplyany(y);
90 #endif // RFFGEN_UTIL_ADDMISSINGOPERATORS_HH
Static checks for detection of presence of different operators and functions.