]> granicus.if.org Git - icinga2/commitdiff
Replace boost foreach and bind
authorJean Flach <jean-marcel.flach@icinga.com>
Tue, 12 Dec 2017 12:29:50 +0000 (13:29 +0100)
committerJean Flach <jean-marcel.flach@icinga.com>
Tue, 12 Dec 2017 12:29:50 +0000 (13:29 +0100)
fixes #5821

plugins/check_disk.cpp

index 75835c8fd42f9eff96feca615def6d7e45885635..f38d2cd64711b768e4904d77a84579e99137ebab 100644 (file)
 #include <Shlwapi.h>
 #include <iostream>
 #include <math.h>
-#include <boost/foreach.hpp>
-#include <boost/bind.hpp>
+#include <functional>
 
 #include "check_disk.h"
 
+using namespace std::placeholders;
+
 #define VERSION 1.1
 
 namespace po = boost::program_options;
@@ -359,7 +360,7 @@ static INT check_drives(std::vector<drive>& vDrives, std::vector<std::wstring>&
                if (debug)
                        std::wcout << "Removing excluded drives\n";
 
-               BOOST_FOREACH(const std::wstring wsDriveName, vExclude_Drives)
+               for (const std::wstring& wsDriveName : vExclude_Drives)
                {
                        vDrives.erase(std::remove_if(vDrives.begin(), vDrives.end(), 
                            std::bind(checkName, _1, wsDriveName + L'\\')), vDrives.end());
@@ -379,7 +380,7 @@ static INT check_drives(std::vector<drive>& vDrives, printInfoStruct& printInfo)
        if (!printInfo.exclude_drives.empty()) {
                if (debug)
                        std::wcout << "Removing excluded drives from user input drives\n";
-               BOOST_FOREACH(std::wstring wsDrive, printInfo.exclude_drives)
+               for (std::wstring& wsDrive : printInfo.exclude_drives)
                {
                        printInfo.drives.erase(std::remove(printInfo.drives.begin(), printInfo.drives.end(), wsDrive),
                            printInfo.drives.end());