23 #ifndef HEPUTILS_H_INCLUDED 24 #define HEPUTILS_H_INCLUDED 31 template<
typename T,
typename U>
34 auto const &
object = *expr;
35 return typeid(object) ==
typeid(T);
38 template<
typename T,
typename U>
39 bool IsOfType(U
const* expr)
41 auto const &
object = *expr;
42 return typeid(object) ==
typeid(T);
45 template<
typename T,
typename U>
46 bool IsOfType(U
const& expr)
48 auto const &
object = *expr;
49 return typeid(object) ==
typeid(T);
52 template<
typename T,
typename U>
55 auto ptr = std::dynamic_pointer_cast<T>(expr);
57 mty::error::TypeError,
58 "Converting an expr to the wrong type in"+
59 std::string(
"ConvertToShared<T>(const csl::Expr&): type =")+
66 template<
typename T,
typename U>
69 return ConvertToShared<T>(expr).
get();
72 template<
typename T,
typename U>
73 const T* ConvertToPtr(
const U* expr)
75 auto ptr =
dynamic_cast<const T*
>(expr);
77 mty::error::TypeError,
78 "Converting an expr to the wrong type in"+
79 std::string(
"ConvertToShared<T>(const csl::Expr&): type =")+
88 template<
typename T,
typename U>
91 return *ConvertToPtr<T>(expr);
94 template<
typename T,
typename U>
97 return *ConvertToPtr<T>(expr);
100 template<
typename T,
typename U>
101 T* ConvertToPtr(U* parent)
103 return dynamic_cast<T*
>(parent);
Namespace of MARTY.
Definition: 2HDM.h:31