osmosdr_device: change cast to make it compile with clang

This commit is contained in:
Dimitri Stolnikov 2012-05-21 00:46:46 +02:00
parent 625c8b8e8e
commit f4f5918c25
1 changed files with 2 additions and 2 deletions

View File

@ -78,9 +78,9 @@ namespace osmosdr {
template <typename T> T cast(const std::string &key, const T &def) const
{
if (!this->count(key)) return def;
try { return boost::lexical_cast<T>((*this)[key]); }
try { return boost::lexical_cast<T>(this->at(key)); }
catch(const boost::bad_lexical_cast &) {
throw std::runtime_error("cannot cast " + key + " = " + (*this)[key]);
throw std::runtime_error("cannot cast " + key + " = " + this->at(key));
}
}
};