Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
@@ -67,6 +67,20 @@ inline void copy(std::map<K,V*>& a_to,const std::map<K,V*>& a_from){
}
}
template <class K,class V>
inline bool add_unique(std::map<K,V*>& a_map,const K& a_key,V* a_value,bool a_delete) {
typedef typename std::map<K,V*>::iterator it_t;
it_t it = a_map.find(a_key);
if(it==a_map.end()) {a_map[a_key] = a_value;return false;} //false=was not found.
if(a_delete) {
V* entry = (*it).second;
a_map.erase(it);
delete entry;
}
a_map[a_key] = a_value;
return true;
}
template <class K,class V>
inline bool find(const std::map<K,V>& a_map,const K& a_key,V& a_value) {
typedef typename std::map<K,V>::const_iterator it_t;
@@ -76,6 +90,14 @@ inline bool find(const std::map<K,V>& a_map,const K& a_key,V& a_value) {
return true;
}
template <class K,class V>
inline bool is_key(const std::map<K,V>& a_map,const K& a_key) {
typedef typename std::map<K,V>::const_iterator it_t;
it_t it = a_map.find(a_key);
if(it==a_map.end()) return false;
return true;
}
}
#endif