]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: Remove backport_std.h entirely
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 22 Dec 2017 23:35:39 +0000 (18:35 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 8 Jan 2018 20:30:05 +0000 (15:30 -0500)
And use the experimental ostream joiner provided with the library.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
18 files changed:
src/common/backport_std.h [deleted file]
src/common/config.h
src/common/convenience.h
src/common/static_ptr.h
src/include/scope_guard.h
src/mds/MDSDaemon.cc
src/msg/QueueStrategy.cc
src/osd/OSD.h
src/rgw/rgw_bucket.cc
src/rgw/rgw_iam_policy.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h
src/rgw/rgw_user.cc
src/test/common/Throttle.cc
src/test/libradosstriper/striping.cc
src/test/librgw_file_marker.cc
src/test/librgw_file_nfsns.cc

diff --git a/src/common/backport_std.h b/src/common/backport_std.h
deleted file mode 100644 (file)
index f748775..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation.  See file COPYING.
- *
- */
-
-#include <memory>
-#include <type_traits>
-
-#ifndef CEPH_COMMON_BACKPORT14_H
-#define CEPH_COMMON_BACKPORT14_H
-
-// Library code from later C++ standards and technical specifications
-// backported to C++14.
-
-namespace ceph {
-
-namespace _backport_ts {
-template <class DelimT,
-          class CharT = char,
-          class Traits = std::char_traits<CharT>>
-class ostream_joiner {
-public:
-  using char_type = CharT;
-  using traits_type = Traits;
-  using ostream_type = std::basic_ostream<CharT, Traits>;
-  using iterator_category = std::output_iterator_tag;
-  using value_type = void;
-  using difference_type = void;
-  using pointer = void;
-  using reference = void;
-
-  ostream_joiner(ostream_type& s, const DelimT& delimiter)
-    : out_stream(std::addressof(out_stream)),
-      delim(delimiter),
-      first_element(true)
-  {}
-  ostream_joiner(ostream_type& s, DelimT&& delimiter)
-    : out_stream(std::addressof(s)),
-      delim(std::move(delimiter)),
-      first_element(true)
-  {}
-
-  template<typename T>
-  ostream_joiner& operator=(const T& value) {
-    if (!first_element)
-      *out_stream << delim;
-    first_element = false;
-    *out_stream << value;
-    return *this;
-  }
-
-  ostream_joiner& operator*() noexcept {
-    return *this;
-  }
-  ostream_joiner& operator++() noexcept {
-    return *this;
-  }
-  ostream_joiner& operator++(int) noexcept {
-    return this;
-  }
-
-private:
-  ostream_type* out_stream;
-  DelimT delim;
-  bool first_element;
-};
-
-template <class CharT, class Traits, class DelimT>
-ostream_joiner<std::decay_t<DelimT>, CharT, Traits>
-make_ostream_joiner(std::basic_ostream<CharT, Traits>& os,
-                    DelimT&& delimiter) {
-  return ostream_joiner<std::decay_t<DelimT>,
-                       CharT, Traits>(os, std::forward<DelimT>(delimiter));
-}
-
-} // namespace _backport_ts
-
-using _backport_ts::ostream_joiner;
-using _backport_ts::make_ostream_joiner;
-} // namespace ceph
-
-#endif // CEPH_COMMON_BACKPORT14_H
index 0e87a08080e574a1f5448204d2f4786699e726c1..6fbdbc098e52d829e45980fc7801f21ab91d702d 100644 (file)
@@ -16,7 +16,6 @@
 #define CEPH_CONFIG_H
 
 #include <map>
-#include "common/backport_std.h"
 #include "common/ConfUtils.h"
 #include "common/entity_name.h"
 #include "common/code_environment.h"
index 49a74a3b3ae187637a63631e3b6eb72cfb095b01..9cd22eb096bfb2ab977e8924148a2871710fc422 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <boost/optional.hpp>
 
-#include "common/backport_std.h"
 #include "common/shunique_lock.h"
 
 #include "include/assert.h" // I despise you. Not you the reader, I'm talking
index 54542ab2ffdf4c2e51c8770f5b8b3365e09620e7..c6d19b499f368e62bebd7db0e01107ce6039bdc8 100644 (file)
@@ -12,8 +12,9 @@
  *
  */
 
+#include <cstddef>
+#include <utility>
 #include <type_traits>
-#include "common/backport_std.h"
 
 namespace ceph {
 // `static_ptr`
index b3eb3fd54700cdb02aa518a32f218b8bbf084e1c..878d8c169f5a34d6114fa39d74df1bad0c0e7e05 100644 (file)
@@ -17,8 +17,6 @@
 
 #include <utility>
 
-#include "common/backport_std.h"
-
 template <typename F>
 struct scope_guard {
   F f;
index 71e7ccd3aab297e68f3bc46546776a76c3ea34d6..cc4555ba3563ce21012444ef1c61b9fd52b922ca 100644 (file)
@@ -21,7 +21,6 @@
 #include "common/Clock.h"
 #include "common/HeartbeatMap.h"
 #include "common/Timer.h"
-#include "common/backport_std.h"
 #include "common/ceph_argparse.h"
 #include "common/config.h"
 #include "common/entity_name.h"
index d72350d217f5b19b7696dfc92ddce8e35901ee6e..8ad15b6d5534724f5109dce34fde9d75e76afea4 100644 (file)
@@ -15,7 +15,6 @@
 #include "QueueStrategy.h"
 #define dout_subsys ceph_subsys_ms
 #include "common/debug.h"
-#include "common/backport_std.h"
 
 QueueStrategy::QueueStrategy(int _n_threads)
   : lock("QueueStrategy::lock"),
index 6f1e5a2d33dd32ee4ce5cfaebcee1849f487c118..14568c7a1979817ecc6e56869c555c1fc92bad1c 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "msg/Dispatcher.h"
 
-#include "common/backport_std.h"
 #include "common/Mutex.h"
 #include "common/RWLock.h"
 #include "common/Timer.h"
index 39c97c29bfa51b92b058d47f1dff9b1f7981afed..10fac5fefa73cbba3a94e140cea791e39ba9dd82 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "common/errno.h"
 #include "common/ceph_json.h"
-#include "common/backport_std.h"
 #include "rgw_rados.h"
 #include "rgw_acl.h"
 #include "rgw_acl_s3.h"
index 91bbabf59590b4e7f1e3efd1b5567820c52d2f42..97aaa3c7745357ef6e8d34bcb4fd7649cb747b4a 100644 (file)
@@ -3,15 +3,16 @@
 
 
 #include <cstring>
+#include <iostream>
 #include <sstream>
 #include <stack>
 #include <utility>
 
+#include <experimental/iterator>
+
 #include <boost/regex.hpp>
-#include <iostream>
 #include "rapidjson/reader.h"
 
-#include "common/backport_std.h"
 #include "rgw_auth.h"
 #include <arpa/inet.h>
 #include "rgw_iam_policy.h"
@@ -1204,7 +1205,7 @@ ostream& print_array(ostream& m, Iterator begin, Iterator end) {
     m << "[]";
   } else {
     m << "[ ";
-    std::copy(begin, end, ceph::make_ostream_joiner(m, ", "));
+    std::copy(begin, end, std::experimental::make_ostream_joiner(m, ", "));
     m << " ]";
   }
   return m;
@@ -1213,7 +1214,7 @@ ostream& print_array(ostream& m, Iterator begin, Iterator end) {
 template<typename Iterator>
 ostream& print_dict(ostream& m, Iterator begin, Iterator end) {
   m << "{ ";
-  std::copy(begin, end, ceph::make_ostream_joiner(m, ", "));
+  std::copy(begin, end, std::experimental::make_ostream_joiner(m, ", "));
   m << " }";
   return m;
 }
index 1f97a35e411765936498a498e37f167fa67f4c50..e8e15f4132d68e1245c8e862e838cc571c9613d1 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "common/Clock.h"
 #include "common/armor.h"
-#include "common/backport_std.h"
 #include "common/errno.h"
 #include "common/mime.h"
 #include "common/utf8.h"
index 9431902eee08626cbcf8e15d1bcba8bd94275aca..d660068e70820046c458c325c13df9b3063617d0 100644 (file)
@@ -10,7 +10,6 @@
 #include "common/utf8.h"
 #include "common/ceph_json.h"
 #include "common/safe_io.h"
-#include "common/backport_std.h"
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/replace.hpp>
 #include <boost/utility/string_view.hpp>
index 65b2052873374ab5d85d5a9d82b3f93c10106539..f9a7baab9794f6b2a4e3239c77078a7b27e6bcff 100644 (file)
@@ -11,7 +11,6 @@
 #include <boost/utility/string_view.hpp>
 #include <boost/container/static_vector.hpp>
 
-#include "common/backport_std.h"
 #include "common/sstring.hh"
 #include "rgw_op.h"
 #include "rgw_rest.h"
index f8712afcf89c3120ae30ebbccd078522696f5344..45430dab6900f003f762bf394375623c18e91617 100644 (file)
@@ -11,7 +11,6 @@
 #include "common/Formatter.h"
 #include "common/ceph_json.h"
 #include "common/RWLock.h"
-#include "common/backport_std.h"
 #include "rgw_rados.h"
 #include "rgw_acl.h"
 
index ad4a816059462a9c9c2b7d286c4f6dd9186add2c..61f77aacf6a71b6b6dd97d7935807476ab9c7ad7 100644 (file)
@@ -33,7 +33,6 @@
 #include "common/Thread.h"
 #include "common/Throttle.h"
 #include "common/ceph_argparse.h"
-#include "common/backport_std.h"
 
 class ThrottleTest : public ::testing::Test {
 protected:
index f31667e868906c65e13565e4b3009d1054e5528b..647014c0d676669481af8921a249fbde66652356 100644 (file)
@@ -8,7 +8,6 @@
 #include "include/radosstriper/libradosstriper.h"
 #include "include/radosstriper/libradosstriper.hpp"
 #include "include/ceph_fs.h"
-#include "common/backport_std.h"
 #include "test/librados/test.h"
 #include "test/libradosstriper/TestCase.h"
 
index 3aaf76d2bd014a9b811b0e0082dc801c18b61b6f..87aa30fb3bd7eedfef40aedd101eed749f8ec92f 100644 (file)
@@ -24,7 +24,6 @@
 #include "rgw/rgw_lib_frontend.h" // direct requests
 
 #include "gtest/gtest.h"
-#include "common/backport_std.h"
 #include "common/ceph_argparse.h"
 #include "common/debug.h"
 #include "global/global_init.h"
index 59dbc2a087ba7bb748e374ad44707fcb3f0f4ba7..fdb78599a578718494319753ecfab2bc70bbefa7 100644 (file)
@@ -24,7 +24,6 @@
 #include "rgw/rgw_lib_frontend.h" // direct requests
 
 #include "gtest/gtest.h"
-#include "common/backport_std.h"
 #include "common/ceph_argparse.h"
 #include "common/debug.h"
 #include "global/global_init.h"