forked from sdr/gr-osmosdr
osmosdr_device: change cast to make it compile with clang
This commit is contained in:
parent
625c8b8e8e
commit
f4f5918c25
|
@ -78,9 +78,9 @@ namespace osmosdr {
|
||||||
template <typename T> T cast(const std::string &key, const T &def) const
|
template <typename T> T cast(const std::string &key, const T &def) const
|
||||||
{
|
{
|
||||||
if (!this->count(key)) return def;
|
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 &) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue