MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ptr_cast_helper< T1 *, T2 > Struct Template Reference

Static Public Member Functions

static T1 * cast (T2 &arg)
 

Detailed Description

template<class T1, class T2>
struct ptr_cast_helper< T1 *, T2 >

Definition at line 73 of file ScalarFunctionsImpl.cc.

Member Function Documentation

template<class T1 , class T2 >
static T1* ptr_cast_helper< T1 *, T2 >::cast ( T2 &  arg)
inlinestatic

Definition at line 74 of file ScalarFunctionsImpl.cc.

74  {
75  T1* out = dynamic_cast<T1*>(arg);
76  if (out == 0) {
77 #ifdef MYDEBUG
78  std::cerr << "ptr_cast error" << std::endl;
79 #endif
80  throw std::bad_cast();
81  }
82  return out;
83  };

The documentation for this struct was generated from the following file: