4 #ifndef tools_safe_cast
5 #define tools_safe_cast
11 template <
class FROM,
class TO>
13 return (TO*)a_o.cast(TO::s_class());
16 template <
class FROM,
class TO>
18 return (
const TO*)a_o.cast(TO::s_class());
21 template <
class FROM,
class TO>
23 return (TO*)a_o.cast(TO::id_class());
26 template <
class FROM,
class TO>
27 inline const TO*
id_cast(
const FROM& a_o) {
28 return (
const TO*)a_o.cast(TO::id_class());