Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -50,6 +50,16 @@ inline bool rfind(const std::vector< std::pair<K,V> >& a_vec,const K& a_key,V& a
return false;
}
template <class K,class V>
inline bool is_key(const std::vector< std::pair<K,V> >& a_vec,const K& a_key) {
typedef typename std::vector< std::pair<K,V> >::const_iterator it_t;
it_t it;
for(it=a_vec.begin();it!=a_vec.end();++it) {
if((*it).first==a_key) return true;
}
return false;
}
template <class K,class V>
inline bool find_key(const std::vector< std::pair<K,V> >& a_vec,const V& a_value,K& a_key) {
typedef typename std::vector< std::pair<K,V> >::const_iterator it_t;
@@ -93,6 +103,21 @@ inline void sort_by_second(std::vector< std::pair<K,V> >& a_vec){
a_vec = v;
}
template <class K,class V>
inline bool remove(std::vector< std::pair<K,V> >& a_vec,const K& a_key,bool a_delete) {
typedef typename std::vector< std::pair<K,V> >::iterator it_t;
it_t it;
for(it=a_vec.begin();it!=a_vec.end();++it) {
if((*it).first==a_key) {
V val = (*it).second;
a_vec.erase(it);
if(a_delete) delete val;
return true;
}
}
return false;
}
}
#endif