| 12345678910111213141516171819202122232425 |
- //
- // to_string.h
- // logger
- //
- // Created by Sam Jaffe on 4/4/19.
- //
- #pragma once
- #include <iostream>
- #include <sstream>
- namespace logging { namespace detail {
- template <typename T>
- void to_stream(T const & obj, std::ostream & os) {
- os << obj;
- }
- template <typename T>
- std::string to_string(T const & obj) {
- std::stringstream ss;
- to_stream(obj, ss);
- return ss.str();
- }
- } }
|