5 #ifndef __pinocchio_utils_static_if_hpp__
6 #define __pinocchio_utils_static_if_hpp__
24 template<
typename LhsType,
typename RhsType,
typename ThenType,
typename ElseType>
27 template<
typename LhsType,
typename RhsType>
31 template<
typename LhsType,
typename RhsType,
typename return_type>
37 template<
typename condition_type,
typename ThenType,
typename ElseType>
44 const condition_type & lhs_value,
45 const condition_type & rhs_value,
46 const ThenType & then_value,
47 const ElseType & else_value)
52 if (lhs_value == rhs_value)
58 if (lhs_value < rhs_value)
64 if (lhs_value <= rhs_value)
70 if (lhs_value >= rhs_value)
76 if (lhs_value > rhs_value)
83 std::logic_error,
"ComparisonOperators " <<
static_cast<int>(op) <<
" is not managed");
87 template<
typename LhsType,
typename RhsType,
typename ThenType,
typename ElseType>
88 inline typename if_then_else_impl<LhsType, RhsType, ThenType, ElseType>::ReturnType
91 const LhsType & lhs_value,
92 const RhsType & rhs_value,
93 const ThenType & then_value,
94 const ElseType & else_value)
97 return algo::run(op, lhs_value, rhs_value, then_value, else_value);
101 template<
typename LhsType,
typename RhsType>
102 struct comparison_eq_impl
104 static inline bool run(
const LhsType & lhs_value,
const RhsType & rhs_value)
106 return lhs_value == rhs_value;
110 template<
typename condition_type>
113 static inline bool run(
const condition_type & lhs_value,
const condition_type & rhs_value)
115 return lhs_value == rhs_value;
119 template<
typename LhsType,
typename RhsType>
120 inline bool comparison_eq(
const LhsType & lhs_value,
const RhsType & rhs_value)