utility_str.hpp 436 B

1234567891011121314151617181920
  1. // Copyright 2019 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. #ifndef BOOST_HISTOGRAM_TEST_UTILITY_STR_HPP
  7. #define BOOST_HISTOGRAM_TEST_UTILITY_STR_HPP
  8. #include <sstream>
  9. #include <string>
  10. template <class T>
  11. std::string str(const T& t) {
  12. std::ostringstream os;
  13. os << t;
  14. return os.str();
  15. }
  16. #endif