to_string.hpp 743 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef BOOST_QVM_TO_STRING_HPP_INCLUDED
  2. #define BOOST_QVM_TO_STRING_HPP_INCLUDED
  3. // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #include <string>
  7. #if __cplusplus >= 201103L
  8. namespace boost { namespace qvm {
  9. namespace
  10. qvm_to_string_detail
  11. {
  12. using std::to_string;
  13. }
  14. } }
  15. #else
  16. #include <sstream>
  17. namespace boost { namespace qvm {
  18. namespace
  19. qvm_to_string_detail
  20. {
  21. template <class T>
  22. std::string
  23. to_string( T const & x )
  24. {
  25. std::stringstream s;
  26. s << x;
  27. return s.str();
  28. }
  29. }
  30. } }
  31. #endif
  32. #endif