Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -29,6 +29,10 @@ inline bool to(const std::string& a_string,bool& a_value,bool a_def = false){
|
||||
}
|
||||
}
|
||||
|
||||
inline bool tob(const std::string& a_string,bool& a_value,bool a_def = false){
|
||||
return to(a_string,a_value,a_def);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include <sstream>
|
||||
@@ -54,4 +58,31 @@ inline bool to(T& a_field,const std::string& a_s,bool& a_changed){
|
||||
|
||||
}
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace tools {
|
||||
|
||||
template <class T>
|
||||
inline bool to(std::ostream& a_out,const std::string& a_string,T& a_value){
|
||||
if(!to<T>(a_string,a_value)) {
|
||||
a_out << "Passed value \"" << a_string << "\""
|
||||
<< " is of bad type."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool to(std::ostream& a_out,const std::string& a_string,bool& a_value){
|
||||
if(!to(a_string,a_value)) {
|
||||
a_out << "Passed value \"" << a_string << "\""
|
||||
<< " is not a boolean."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user