10 lines
211 B
C++
10 lines
211 B
C++
#ifndef PKMNLIB_REFCAST_HPP
|
|
#define PKMNLIB_REFCAST_HPP
|
|
template <class A, class B> B* refCast(A* a) {
|
|
if (!a)
|
|
return 0;
|
|
B* b = dynamic_cast<B*>(a);
|
|
return b;
|
|
}
|
|
#endif // PKMNLIB_REFCAST_HPP
|