2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-01-20 04:42:19 +00:00
Files
mysql/test/common/include/test_common/stringize.hpp
Anarthal (Rubén Pérez) 793b678287 Updated file copyrights to 2025
2025-02-11 20:42:41 +01:00

40 lines
930 B
C++

//
// Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_STRINGIZE_HPP
#define BOOST_MYSQL_TEST_COMMON_INCLUDE_TEST_COMMON_STRINGIZE_HPP
#include <sstream>
#include <string>
namespace boost {
namespace mysql {
namespace test {
inline void stringize_helper(std::ostream&) noexcept {}
template <class T, class... Types>
void stringize_helper(std::ostream& os, const T& input, const Types&... tail)
{
os << input;
stringize_helper(os, tail...);
}
template <class... Types>
std::string stringize(const Types&... inputs)
{
std::ostringstream ss;
stringize_helper(ss, inputs...);
return ss.str();
}
} // namespace test
} // namespace mysql
} // namespace boost
#endif