Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <sstream> 7 : #include <string> 8 : 9 : /*! 10 : * \ingroup UtilitiesGroup 11 : * \brief Get the streamed output of `t` as a `std::string` 12 : */ 13 : template <typename T> 14 1 : std::string get_output(const T& t) { 15 : std::ostringstream os; 16 : os << t; 17 : return os.str(); 18 : }