diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-06-27 19:06:50 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-06-29 13:40:07 -0700 |
commit | 47cdd6319c74a7b823843aad5ff3fa370ed1e6ef (patch) | |
tree | 216e88f36dbb5ba0b933f0a5ec3c2a151e972589 /host/lib/usrp/common | |
parent | 412a7053cc0698fd8e1a09d9c40ec2f96cf629af (diff) | |
download | uhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.tar.gz uhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.tar.bz2 uhd-47cdd6319c74a7b823843aad5ff3fa370ed1e6ef.zip |
uhd: Replaced many lexical_cast with appropriate C++11 equivalents
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r-- | host/lib/usrp/common/constrained_device_args.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/host/lib/usrp/common/constrained_device_args.hpp b/host/lib/usrp/common/constrained_device_args.hpp index 47c5f4cc0..42632d0dd 100644 --- a/host/lib/usrp/common/constrained_device_args.hpp +++ b/host/lib/usrp/common/constrained_device_args.hpp @@ -20,7 +20,6 @@ #include <uhd/types/device_addr.hpp> #include <uhd/exception.hpp> -#include <boost/lexical_cast.hpp> #include <boost/format.hpp> #include <boost/algorithm/string.hpp> #include <boost/assign/list_of.hpp> @@ -116,7 +115,7 @@ namespace usrp { } } inline virtual std::string to_string() const { - return key() + "=" + boost::lexical_cast<std::string>(get()); + return key() + "=" + std::to_string(get()); } private: data_t _value; @@ -192,7 +191,7 @@ namespace usrp { } inline void parse(const std::string& str_rep) { try { - _value = (boost::lexical_cast<int>(str_rep) != 0); + _value = (std::stoi(str_rep) != 0); } catch (std::exception& ex) { if (str_rep.empty()) { //If str_rep is empty then the device_addr was set @@ -250,7 +249,7 @@ namespace usrp { throw uhd::value_error(str(boost::format( "Invalid device arg value: %s (Minimum: %s, Maximum: %s)") % arg.to_string() % - boost::lexical_cast<std::string>(min) % boost::lexical_cast<std::string>(max))); + std::to_string(min) % std::to_string(max))); } } @@ -269,7 +268,7 @@ namespace usrp { if (!match) { std::string valid_values_str; for (size_t i = 0; i < valid_values.size(); i++) { - valid_values_str += ((i==0)?"":", ") + boost::lexical_cast<std::string>(valid_values[i]); + valid_values_str += ((i==0)?"":", ") + std::to_string(valid_values[i]); throw uhd::value_error(str(boost::format( "Invalid device arg value: %s (Valid: {%s})") % arg.to_string() % valid_values_str |