From 26cc20847cde543e759aa5cee9a27eaa69c5dd9e Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Thu, 9 Feb 2017 23:19:55 -0800 Subject: uhd: replace BOOST_FOREACH with C++11 range-based for loop Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development. --- host/lib/property_tree.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'host/lib/property_tree.cpp') diff --git a/host/lib/property_tree.cpp b/host/lib/property_tree.cpp index 76d7bccba..d62f61878 100644 --- a/host/lib/property_tree.cpp +++ b/host/lib/property_tree.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -98,7 +97,7 @@ public: node_type *parent = NULL; node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &name, path_tokenizer(path)){ + for(const std::string &name: path_tokenizer(path)){ if (not node->has_key(name)) throw_path_not_found(path); parent = node; node = &(*node)[name]; @@ -112,7 +111,7 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &name, path_tokenizer(path)){ + for(const std::string &name: path_tokenizer(path)){ if (not node->has_key(name)) return false; node = &(*node)[name]; } @@ -124,7 +123,7 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &name, path_tokenizer(path)){ + for(const std::string &name: path_tokenizer(path)){ if (not node->has_key(name)) throw_path_not_found(path); node = &(*node)[name]; } @@ -137,7 +136,7 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &name, path_tokenizer(path)){ + for(const std::string &name: path_tokenizer(path)){ if (not node->has_key(name)) (*node)[name] = node_type(); node = &(*node)[name]; } @@ -150,7 +149,7 @@ public: boost::mutex::scoped_lock lock(_guts->mutex); node_type *node = &_guts->root; - BOOST_FOREACH(const std::string &name, path_tokenizer(path)){ + for(const std::string &name: path_tokenizer(path)){ if (not node->has_key(name)) throw_path_not_found(path); node = &(*node)[name]; } -- cgit v1.2.3