13 #ifndef __STOUT_FORMAT_HPP__ 14 #define __STOUT_FORMAT_HPP__ 26 #include <type_traits> 51 template <
typename T,
bool b>
57 template <
typename... T>
71 if (
vasprintf(&temp, fmt.c_str(), args) == -1) {
73 return Error(
"Failed to format '" + fmt +
"' (possibly out of memory)");
75 std::string result(temp);
99 const T&
get() {
return t; }
104 template <
typename T>
108 const char*
get() {
return s.c_str(); }
121 const char*
get() {
return s.c_str(); }
122 const std::string&
s;
128 #endif // __STOUT_FORMAT_HPP__
stringify(const T &_t)
Definition: format.hpp:107
Definition: errorbase.hpp:36
const std::string & s
Definition: format.hpp:122
Definition: format.hpp:45
const std::string s
Definition: format.hpp:113
Definition: type_utils.hpp:619
Definition: format.hpp:52
stringify(const T &_t)
Definition: format.hpp:98
Definition: attributes.hpp:24
const T & t
Definition: format.hpp:100
std::string temp()
Definition: temp.hpp:27
Try< std::string > format(const std::string &fmt, va_list args)
Definition: format.hpp:68
stringify(const std::string &_s)
Definition: format.hpp:120