25 #ifndef ICL_CORE_CONFIG_UTIL_H_INCLUDED 26 #define ICL_CORE_CONFIG_UTIL_H_INCLUDED 32 #include <boost/algorithm/string.hpp> 42 template <
typename T,
typename U>
45 std::stringstream interpreter;
46 interpreter.setf(std::ios::fmtflags(), std::ios::basefield);
49 interpreter >> result;
62 std::stringstream interpreter;
63 interpreter.setf(std::ios::fmtflags(), std::ios::basefield);
66 interpreter >> result;
67 boost::algorithm::to_lower(result);
68 if (result ==
"1" || result ==
"yes" || result ==
"true")
89 std::stringstream interpreter;
90 interpreter.setf(std::ios::fmtflags(), std::ios::basefield);
93 interpreter >> result;
94 boost::algorithm::to_lower(result);
95 if (result ==
"1" || result ==
"yes" || result ==
"true")
99 else if (result ==
"0" || result ==
"no" || result ==
"false")
105 throw std::invalid_argument(
"Not a boolean value: " + result);
bool strict_bool_cast(U input)