// Copyright (C) 2010, Guy Barrand. All rights reserved. // See the file tools.license for terms. #ifndef tools_safe_cast #define tools_safe_cast #include "cid" namespace tools { template inline TO* safe_cast(FROM& a_o) { return (TO*)a_o.cast(TO::s_class()); } template inline const TO* safe_cast(const FROM& a_o) { return (const TO*)a_o.cast(TO::s_class()); } template inline TO* id_cast(FROM& a_o) { return (TO*)a_o.cast(TO::id_class()); } template inline const TO* id_cast(const FROM& a_o) { return (const TO*)a_o.cast(TO::id_class()); } } #endif