summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2018-11-07 10:17:31 -0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-01-11 16:59:29 +0000
commit54012504ba816fd0659b497a3c7e1c50f7c0f2d7 (patch)
tree3ce8d46098290e9c2329ba69caf82b2304b33925
parent1e3455aec7e2d57e97d4a3e2a7e291488d55dbb0 (diff)
downloadphosphor-host-ipmid-54012504ba816fd0659b497a3c7e1c50f7c0f2d7.tar.gz
phosphor-host-ipmid-54012504ba816fd0659b497a3c7e1c50f7c0f2d7.zip
ipmid: replace std::experimental::optional with std::optional
Now that the project is using c++17, std::optional can be used directly instead of via the std::experimental way. Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com> Change-Id: I7087f58bd3d9fd90b8b31e6902554351a3db2d0f
-rw-r--r--utils.cpp13
-rw-r--r--utils.hpp6
2 files changed, 9 insertions, 10 deletions
diff --git a/utils.cpp b/utils.cpp
index f6a840a..4aaf9c0 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -227,15 +227,14 @@ void setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
}
ServiceCache::ServiceCache(const std::string& intf, const std::string& path) :
- intf(intf), path(path), cachedService(std::experimental::nullopt),
- cachedBusName(std::experimental::nullopt)
+ intf(intf), path(path), cachedService(std::nullopt),
+ cachedBusName(std::nullopt)
{
}
ServiceCache::ServiceCache(std::string&& intf, std::string&& path) :
- intf(std::move(intf)), path(std::move(path)),
- cachedService(std::experimental::nullopt),
- cachedBusName(std::experimental::nullopt)
+ intf(std::move(intf)), path(std::move(path)), cachedService(std::nullopt),
+ cachedBusName(std::nullopt)
{
}
@@ -251,8 +250,8 @@ const std::string& ServiceCache::getService(sdbusplus::bus::bus& bus)
void ServiceCache::invalidate()
{
- cachedBusName = std::experimental::nullopt;
- cachedService = std::experimental::nullopt;
+ cachedBusName = std::nullopt;
+ cachedService = std::nullopt;
}
sdbusplus::message::message
diff --git a/utils.hpp b/utils.hpp
index 8b69b09..a100718 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "types.hpp"
-#include <experimental/optional>
+#include <optional>
#include <sdbusplus/server.hpp>
namespace ipmi
@@ -76,9 +76,9 @@ class ServiceCache
/** @brief DBUS path provided by the service */
const std::string path;
/** @brief The name of the service if valid */
- std::experimental::optional<std::string> cachedService;
+ std::optional<std::string> cachedService;
/** @brief The name of the bus used in the service lookup */
- std::experimental::optional<std::string> cachedBusName;
+ std::optional<std::string> cachedBusName;
};
/**
OpenPOWER on IntegriCloud