Remove old experimental includes

We are now using c++17 so we no longer need experimental optional and
any. We can use the standard any and optional now.

Change-Id: I88fcb4258c69ac5ad9766e2c65463c52a3b7f05f
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index 5fa6404..7435ef3 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -131,7 +131,7 @@
  * are created and the InterfacesAdded signal is emitted. The object's state
  * data is then returned for sensor state monitoring within the main loop.
  */
-optional_ns::optional<ObjectStateData>
+std::optional<ObjectStateData>
     MainLoop::getObject(SensorSet::container_t::const_reference sensor)
 {
     auto properties = getIdentifiers(sensor);
@@ -377,8 +377,9 @@
                     auto fault = ioAccess.read(
                         i.first.first, i.first.second, hwmon::entry::fault,
                         hwmonio::retries, hwmonio::delay);
-                    auto statusIface = std::experimental::any_cast<
-                        std::shared_ptr<StatusObject>>(it->second);
+                    auto statusIface =
+                        std::any_cast<std::shared_ptr<StatusObject>>(
+                            it->second);
                     if (!statusIface->functional((fault == 0) ? true : false))
                     {
                         continue;
@@ -408,8 +409,9 @@
                     switch (iface.first)
                     {
                         case InterfaceType::VALUE:
-                            valueIface = std::experimental::any_cast<
-                                std::shared_ptr<ValueObject>>(iface.second);
+                            valueIface =
+                                std::any_cast<std::shared_ptr<ValueObject>>(
+                                    iface.second);
                             valueIface->value(value);
                             break;
                         case InterfaceType::WARN:
diff --git a/mainloop.hpp b/mainloop.hpp
index 77419e5..9c50c78 100644
--- a/mainloop.hpp
+++ b/mainloop.hpp
@@ -8,9 +8,9 @@
 #include "timer.hpp"
 #include "types.hpp"
 
-#include <experimental/any>
-#include <experimental/optional>
+#include <any>
 #include <memory>
+#include <optional>
 #include <sdbusplus/server.hpp>
 #include <string>
 #include <vector>
@@ -21,8 +21,6 @@
 static constexpr auto sensorLabel = 1;
 using SensorIdentifiers = std::tuple<std::string, std::string>;
 
-namespace optional_ns = std::experimental;
-
 /** @class MainLoop
  *  @brief hwmon-readd main application loop.
  */
@@ -135,6 +133,6 @@
      * @return - Optional
      *     Object state data on success, nothing on failure
      */
-    optional_ns::optional<ObjectStateData>
+    std::optional<ObjectStateData>
         getObject(SensorSet::container_t::const_reference sensor);
 };
diff --git a/sensor.cpp b/sensor.cpp
index 21f3d87..0a0971f 100644
--- a/sensor.cpp
+++ b/sensor.cpp
@@ -118,9 +118,7 @@
     auto it = obj.find(InterfaceType::STATUS);
     if (it != obj.end())
     {
-        statusIface =
-            std::experimental::any_cast<std::shared_ptr<StatusObject>>(
-                it->second);
+        statusIface = std::any_cast<std::shared_ptr<StatusObject>>(it->second);
     }
 
     // If there's no fault file or the sensor has a fault file and
diff --git a/thresholds.hpp b/thresholds.hpp
index 8b5329c..7e8dbf5 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -57,9 +57,9 @@
  *  @param[in] value - The sensor reading to compare to thresholds.
  */
 template <typename T>
-void checkThresholds(std::experimental::any& iface, int64_t value)
+void checkThresholds(std::any& iface, int64_t value)
 {
-    auto realIface = std::experimental::any_cast<std::shared_ptr<T>>(iface);
+    auto realIface = std::any_cast<std::shared_ptr<T>>(iface);
     auto lo = (*realIface.*Thresholds<T>::getLo)();
     auto hi = (*realIface.*Thresholds<T>::getHi)();
     (*realIface.*Thresholds<T>::alarmLo)(value <= lo);
diff --git a/types.hpp b/types.hpp
index a33869c..d5a096b 100644
--- a/types.hpp
+++ b/types.hpp
@@ -2,9 +2,9 @@
 
 #include "interface.hpp"
 
-#include <experimental/any>
+#include <any>
 
-using Object = std::map<InterfaceType, std::experimental::any>;
+using Object = std::map<InterfaceType, std::any>;
 using ObjectInfo = std::tuple<sdbusplus::bus::bus*, std::string, Object>;
 using RetryIO = std::tuple<size_t, std::chrono::milliseconds>;
 using ObjectStateData = std::pair<std::string, ObjectInfo>;