]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/date_time/date_generators.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / date_time / date_generators.hpp
index 67bfd5f0772aed38c19c4cf54badbdbe84ad3cb0..82bd0a0567023746a0c572521ef1a2a9e1d50188 100644 (file)
@@ -153,9 +153,18 @@ namespace date_time {
    month_type month_;
  };
 
-
   //! Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5.
-  BOOST_DATE_TIME_DECL const char* nth_as_str(int n);
+  inline const char* nth_as_str(int ele)
+  {
+    static const char* const _nth_as_str[] = {"out of range", "first", "second",
+                                              "third", "fourth", "fifth"};
+    if(ele >= 1 && ele <= 5) {
+      return _nth_as_str[ele];
+    }
+    else {
+      return _nth_as_str[0];
+    }
+  }
 
   //! Useful generator functor for finding holidays
   /*! Based on the idea in Cal. Calc. for finding holidays that are