bmcweb: Move boost::optional to std::optional
This change is largely a sed replace, and gets us closer to standards
compliance.
Change-Id: Ie60437eff43de830ef19389344a55430dabd9d16
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 97e5f64..475e09c 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -181,8 +181,8 @@
std::string username;
std::string password;
- boost::optional<std::string> roleId("User");
- boost::optional<bool> enabled = true;
+ std::optional<std::string> roleId("User");
+ std::optional<bool> enabled = true;
if (!json_util::readJson(req, res, "UserName", username, "Password",
password, "RoleId", roleId, "Enabled",
enabled))
@@ -412,10 +412,10 @@
return;
}
- boost::optional<std::string> newUserName;
- boost::optional<std::string> password;
- boost::optional<bool> enabled;
- boost::optional<std::string> roleId;
+ std::optional<std::string> newUserName;
+ std::optional<std::string> password;
+ std::optional<bool> enabled;
+ std::optional<std::string> roleId;
if (!json_util::readJson(req, res, "UserName", newUserName, "Password",
password, "RoleId", roleId, "Enabled",
enabled))
@@ -460,9 +460,9 @@
void updateUserProperties(std::shared_ptr<AsyncResp> asyncResp,
const std::string& username,
- boost::optional<std::string> password,
- boost::optional<bool> enabled,
- boost::optional<std::string> roleId)
+ std::optional<std::string> password,
+ std::optional<bool> enabled,
+ std::optional<std::string> roleId)
{
if (password)
{
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 58896d8..d3fe1fe 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -17,10 +17,10 @@
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
-#include <boost/optional.hpp>
#include <dbus_singleton.hpp>
#include <error_messages.hpp>
#include <node.hpp>
+#include <optional>
#include <utils/json_utils.hpp>
namespace redfish
@@ -80,7 +80,7 @@
std::string hostname;
std::string default_gateway;
std::string mac_address;
- boost::optional<uint32_t> vlan_id;
+ std::optional<uint32_t> vlan_id;
};
// Helper function that changes bits netmask notation (i.e. /24)
@@ -1028,7 +1028,7 @@
}
}
- boost::optional<uint8_t> prefixLength;
+ std::optional<uint8_t> prefixLength;
const std::string *subnetField = nullptr;
nlohmann::json::const_iterator subnetFieldIt =
thisJson.find("SubnetMask");
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 12f15d1..354570c 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -764,7 +764,7 @@
messages::success(asyncResp->res);
std::string indicatorLedTemp;
- boost::optional<std::string> indicatorLed = indicatorLedTemp;
+ std::optional<std::string> indicatorLed = indicatorLedTemp;
if (!json_util::readJson(req, res, "IndicatorLed", indicatorLed))
{
return;