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/examples/txrx_loopback_to_file.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'host/examples/txrx_loopback_to_file.cpp') diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index eb2cd72a3..b0907f162 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -267,21 +266,21 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::vector tx_channel_nums; boost::split(tx_channel_strings, tx_channels, boost::is_any_of("\"',")); for(size_t ch = 0; ch < tx_channel_strings.size(); ch++){ - size_t chan = boost::lexical_cast(tx_channel_strings[ch]); + size_t chan = std::stoi(tx_channel_strings[ch]); if(chan >= tx_usrp->get_tx_num_channels()){ throw std::runtime_error("Invalid TX channel(s) specified."); } - else tx_channel_nums.push_back(boost::lexical_cast(tx_channel_strings[ch])); + else tx_channel_nums.push_back(std::stoi(tx_channel_strings[ch])); } std::vector rx_channel_strings; std::vector rx_channel_nums; boost::split(rx_channel_strings, rx_channels, boost::is_any_of("\"',")); for(size_t ch = 0; ch < rx_channel_strings.size(); ch++){ - size_t chan = boost::lexical_cast(rx_channel_strings[ch]); + size_t chan = std::stoi(rx_channel_strings[ch]); if(chan >= rx_usrp->get_rx_num_channels()){ throw std::runtime_error("Invalid RX channel(s) specified."); } - else rx_channel_nums.push_back(boost::lexical_cast(rx_channel_strings[ch])); + else rx_channel_nums.push_back(std::stoi(rx_channel_strings[ch])); } //Lock mboard clocks -- cgit v1.2.3