20 #include <type_traits> 39 if constexpr (std::is_polymorphic<T>::value)
41 return dynamic_cast<U>(iPtr);
74 template<
typename From,
typename To>
92 template<
typename From,
typename To>
123 s <<
typeid(T).name();
124 if(std::is_const_v<
typename std::remove_reference<T>::type>)
126 if(std::is_reference_v<T>)
decltype(static_cast< To >(std::declval< From >())) static_cast_t
Defines the type for static_cast<To>(From)
Definition: Metaprogramming.h:75
Definition: CircularBuffer.h:25
static U dynamic(T *iPtr)
Definition: Metaprogramming.h:37
std::string typeString()
typeid(T).name() does not account for const or reference.
Definition: Metaprogramming.h:120
dynamic_cast<U *>(x) does not compile if x is not polymorphic.
Definition: Metaprogramming.h:33
constexpr auto is_operator_write_to_ostream_defined
Allows to detect whether a type defines ostream << x at compile time.
Definition: Metaprogramming.h:114
decltype(std::declval< std::ostream & >()<< std::declval< T const & >()) operator_write_to_ostream_t
Defines the type for operator<<
Definition: Metaprogramming.h:99
constexpr auto is_operator_not_eq_defined
Allows to detect whether a type defines operator!= at compile time.
Definition: Metaprogramming.h:69
constexpr auto is_static_cast_defined
Allows to detect (at compilation time) whether the call static_cast<To>(from) (where from is of type ...
Definition: Metaprogramming.h:93
decltype(std::declval< T const & >() !=std::declval< T const & >()) operator_not_eq_t
Defines the type for operator!=
Definition: Metaprogramming.h:54