Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
+33
View File
@@ -0,0 +1,33 @@
// 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 <class FROM,class TO>
inline TO* safe_cast(FROM& a_o) {
return (TO*)a_o.cast(TO::s_class());
}
template <class FROM,class TO>
inline const TO* safe_cast(const FROM& a_o) {
return (const TO*)a_o.cast(TO::s_class());
}
template <class FROM,class TO>
inline TO* id_cast(FROM& a_o) {
return (TO*)a_o.cast(TO::id_class());
}
template <class FROM,class TO>
inline const TO* id_cast(const FROM& a_o) {
return (const TO*)a_o.cast(TO::id_class());
}
}
#endif