Imported Upstream version 1.71.0
[platform/upstream/boost.git] / boost / histogram / detail / cat.hpp
1 // Copyright 2015-2017 Hans Dembinski
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_HISTOGRAM_DETAIL_CAT_HPP
8 #define BOOST_HISTOGRAM_DETAIL_CAT_HPP
9
10 #include <boost/config.hpp>
11 #include <sstream>
12
13 namespace boost {
14 namespace histogram {
15 namespace detail {
16 BOOST_ATTRIBUTE_UNUSED inline void cat_impl(std::ostringstream&) {}
17
18 template <typename T, typename... Ts>
19 void cat_impl(std::ostringstream& os, const T& t, const Ts&... ts) {
20   os << t;
21   cat_impl(os, ts...);
22 }
23
24 template <typename... Ts>
25 std::string cat(const Ts&... args) {
26   std::ostringstream os;
27   cat_impl(os, args...);
28   return os.str();
29 }
30 } // namespace detail
31 } // namespace histogram
32 } // namespace boost
33
34 #endif