Files
PkmnLib/src/ScriptResolving/AngelScript/TypeRegistry/RefCast.hpp
Deukhoofd c4b866cb38
All checks were successful
continuous-integration/drone/push Build is passing
File formatting.
2020-04-28 14:48:56 +02:00

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