5 #ifndef __pinocchio_utils_static_if_hpp__ 6 #define __pinocchio_utils_static_if_hpp__ 8 #include "pinocchio/fwd.hpp" 15 template<
typename if_type,
typename then_type,
typename else_type>
16 struct if_then_else_impl;
18 template<
typename if_type,
typename same_then_and_else_type>
19 struct traits<if_then_else_impl<if_type,same_then_and_else_type,same_then_and_else_type> >
21 typedef same_then_and_else_type ReturnType;
24 template<
typename then_type,
typename else_type>
25 struct if_then_else_impl<bool,then_type,else_type>
27 typedef typename internal::traits<if_then_else_impl>::ReturnType ReturnType;
29 static inline ReturnType run(
bool condition,
30 const then_type & then_value,
31 const else_type & else_value)
40 template<
typename if_type,
typename then_type,
typename else_type>
41 inline typename if_then_else_impl<if_type,then_type,else_type>::ReturnType
42 if_then_else(
const if_type & condition,
43 const then_type & then_value,
44 const else_type & else_value)
46 return if_then_else_impl<if_type,then_type,else_type>::run(condition,
Main pinocchio namespace.