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/utils/paths.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'host/lib/utils/paths.cpp') diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index 38839c8d4..5d53f95bd 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -98,7 +97,7 @@ static std::vector get_env_paths(const std::string &var_name){ //convert to full filesystem path, filter blank paths if (var_value.empty()) return paths; - BOOST_FOREACH(const std::string &path_string, path_tokenizer(var_value)){ + for(const std::string &path_string: path_tokenizer(var_value)){ if (path_string.empty()) continue; paths.push_back(fs::system_complete(path_string).string()); } @@ -190,7 +189,7 @@ std::vector uhd::get_module_paths(void){ std::vector paths; std::vector env_paths = get_env_paths("UHD_MODULE_PATH"); - BOOST_FOREACH(std::string &str_path, env_paths) { + for(std::string &str_path: env_paths) { paths.push_back(str_path); } @@ -272,7 +271,7 @@ std::string uhd::get_images_dir(const std::string &search_paths) { /* We will start by looking for a path indicated by the `UHD_IMAGES_DIR` * environment variable. */ std::vector env_paths = get_env_paths("UHD_IMAGES_DIR"); - BOOST_FOREACH(possible_dir, env_paths) { + for(auto possible_dir: env_paths) { if (fs::is_directory(fs::path(possible_dir))) { return possible_dir; } @@ -293,7 +292,7 @@ std::string uhd::get_images_dir(const std::string &search_paths) { std::vector search_paths_vector; boost::split(search_paths_vector, _search_paths, boost::is_any_of(",;")); - BOOST_FOREACH(std::string& search_path, search_paths_vector) { + for(std::string& search_path: search_paths_vector) { boost::algorithm::trim(search_path); if (search_path.empty()) continue; -- cgit v1.2.3