And use the experimental ostream joiner provided with the library.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
+++ /dev/null
-// -*- 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
#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"
#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
*
*/
+#include <cstddef>
+#include <utility>
#include <type_traits>
-#include "common/backport_std.h"
namespace ceph {
// `static_ptr`
#include <utility>
-#include "common/backport_std.h"
-
template <typename F>
struct scope_guard {
F f;
#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"
#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"),
#include "msg/Dispatcher.h"
-#include "common/backport_std.h"
#include "common/Mutex.h"
#include "common/RWLock.h"
#include "common/Timer.h"
#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"
#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"
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;
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;
}
#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"
#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>
#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"
#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"
#include "common/Thread.h"
#include "common/Throttle.h"
#include "common/ceph_argparse.h"
-#include "common/backport_std.h"
class ThrottleTest : public ::testing::Test {
protected:
#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"
#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"
#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"