]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/options.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / options.h
index 6adee886d0303ecd809fed9e0b9cc6bde5f97f53..e1d4ec16ed704c88925cec163a2d76da527420dc 100644 (file)
@@ -5,8 +5,8 @@
 
 #include <chrono>
 #include <string>
+#include <variant>
 #include <vector>
-#include <boost/variant.hpp>
 #include "include/str_list.h"
 #include "msg/msg_types.h"
 #include "include/uuid.h"
@@ -136,8 +136,8 @@ struct Option {
     }
   };
 
-  using value_t = boost::variant<
-    boost::blank,
+  using value_t = std::variant<
+    std::monostate,
     std::string,
     uint64_t,
     int64_t,
@@ -198,7 +198,7 @@ struct Option {
   Option(std::string const &name, type_t t, level_t l)
     : name(name), type(t), level(l)
   {
-    // While value_t is nullable (via boost::blank), we don't ever
+    // While value_t is nullable (via std::monostate), we don't ever
     // want it set that way in an Option instance: within an instance,
     // the type of ::value should always match the declared type.
     switch (type) {
@@ -399,5 +399,26 @@ struct Option {
   }
 };
 
-extern const std::vector<Option> ceph_options;
+constexpr unsigned long long operator"" _min (unsigned long long min) {
+  return min * 60;
+}
+constexpr unsigned long long operator"" _hr (unsigned long long hr) {
+  return hr * 60 * 60;
+}
+constexpr unsigned long long operator"" _day (unsigned long long day) {
+  return day * 24 * 60 * 60;
+}
+constexpr unsigned long long operator"" _K (unsigned long long n) {
+  return n << 10;
+}
+constexpr unsigned long long operator"" _M (unsigned long long n) {
+  return n << 20;
+}
+constexpr unsigned long long operator"" _G (unsigned long long n) {
+  return n << 30;
+}
+constexpr unsigned long long operator"" _T (unsigned long long n) {
+  return n << 40;
+}
 
+extern const std::vector<Option> ceph_options;