From 47cdd6319c74a7b823843aad5ff3fa370ed1e6ef Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 27 Jun 2017 19:06:50 -0700 Subject: uhd: Replaced many lexical_cast with appropriate C++11 equivalents --- host/lib/usrp/common/constrained_device_args.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'host/lib/usrp/common') 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 #include -#include #include #include #include @@ -116,7 +115,7 @@ namespace usrp { } } inline virtual std::string to_string() const { - return key() + "=" + boost::lexical_cast(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(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(min) % boost::lexical_cast(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(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 -- cgit v1.2.3