treewide: Remove use of c++23 in headers

We still have some applications which are building in c++20 mode so we
can't use these yet.

Change-Id: Ic2f92cf329ac843f170b660ce2a7128694465192
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include-dl/stdplus/dl.hpp b/include-dl/stdplus/dl.hpp
index 223af24..3ab6529 100644
--- a/include-dl/stdplus/dl.hpp
+++ b/include-dl/stdplus/dl.hpp
@@ -27,7 +27,7 @@
 {
   public:
     constexpr DlOpenFlags(DlOpenType type) :
-        BitFlags<DlOpenFlag>(std::to_underlying(type))
+        BitFlags<DlOpenFlag>(static_cast<int>(type))
     {}
 
     constexpr DlOpenFlags(BitFlags<DlOpenFlag> flags) :
diff --git a/include-fd/stdplus/fd/create.hpp b/include-fd/stdplus/fd/create.hpp
index 9cdeba4..8488b20 100644
--- a/include-fd/stdplus/fd/create.hpp
+++ b/include-fd/stdplus/fd/create.hpp
@@ -45,7 +45,7 @@
 {
   public:
     constexpr OpenFlags(OpenAccess access) :
-        BitFlags<OpenFlag>(std::to_underlying(access))
+        BitFlags<OpenFlag>(static_cast<int>(access))
     {}
 
     constexpr OpenFlags(BitFlags<OpenFlag> flags) : BitFlags<OpenFlag>(flags) {}
diff --git a/include-fd/stdplus/fd/intf.hpp b/include-fd/stdplus/fd/intf.hpp
index ced525b..9faff66 100644
--- a/include-fd/stdplus/fd/intf.hpp
+++ b/include-fd/stdplus/fd/intf.hpp
@@ -105,7 +105,7 @@
 {
   public:
     constexpr MMapFlags(MMapAccess access) :
-        BitFlags<MMapFlag>(std::to_underlying(access))
+        BitFlags<MMapFlag>(static_cast<int>(access))
     {}
 
     constexpr MMapFlags(BitFlags<MMapFlag> flags) : BitFlags<MMapFlag>(flags) {}
diff --git a/include/stdplus/flags.hpp b/include/stdplus/flags.hpp
index d0e091a..1a6256a 100644
--- a/include/stdplus/flags.hpp
+++ b/include/stdplus/flags.hpp
@@ -16,28 +16,28 @@
     using underlying = I;
 
     constexpr BitFlags() noexcept : val(0) {}
-    constexpr BitFlags(type t) noexcept : val(std::to_underlying(t)) {}
+    constexpr BitFlags(type t) noexcept : val(static_cast<underlying>(t)) {}
     explicit constexpr BitFlags(underlying val) noexcept : val(val) {}
 
     constexpr BitFlags& set(type flag) & noexcept
     {
-        val |= std::to_underlying(flag);
+        val |= static_cast<underlying>(flag);
         return *this;
     }
     constexpr BitFlags&& set(type flag) && noexcept
     {
-        val |= std::to_underlying(flag);
+        val |= static_cast<underlying>(flag);
         return std::move(*this);
     }
 
     constexpr BitFlags& unset(type flag) & noexcept
     {
-        val &= ~std::to_underlying(flag);
+        val &= ~static_cast<underlying>(flag);
         return *this;
     }
     constexpr BitFlags&& unset(type flag) && noexcept
     {
-        val &= ~std::to_underlying(flag);
+        val &= ~static_cast<underlying>(flag);
         return std::move(*this);
     }