]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include/random: use std::optional instead of boost::optional
authorMax Kellermann <max.kellermann@ionos.com>
Tue, 29 Oct 2024 09:49:19 +0000 (10:49 +0100)
committerMax Kellermann <max.kellermann@ionos.com>
Mon, 9 Dec 2024 11:57:31 +0000 (12:57 +0100)
`boost::optional` is obsolete since C++17.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/include/random.h

index f2e3e37bcd7520c20a65e2f016b1dfbc929bdcec..6b7c9405efd2f6ba1ee5804d3433b5b96eb888f8 100644 (file)
@@ -16,9 +16,9 @@
 #define CEPH_RANDOM_H 1
 
 #include <mutex>
+#include <optional>
 #include <random>
 #include <type_traits>
-#include <boost/optional.hpp>
 
 // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85494
 #ifdef __MINGW32__
@@ -123,7 +123,7 @@ void randomize_rng()
 template <typename EngineT>
 EngineT& engine()
 {
-  thread_local boost::optional<EngineT> rng_engine;
+  thread_local std::optional<EngineT> rng_engine;
 
   if (!rng_engine) {
     rng_engine.emplace(EngineT());