| 51 | */ |
| 52 | template <typename... Ts> |
| 53 | inline std::string string_with_format(const std::string &fmt, Ts &&...args) |
| 54 | { |
| 55 | size_t size = support::cpp11::snprintf(nullptr, 0, fmt.c_str(), args...) + 1; |
| 56 | auto char_str = std::make_unique<char[]>(size); |
| 57 | support::cpp11::snprintf(char_str.get(), size, fmt.c_str(), args...); |
| 58 | return std::string(char_str.get(), char_str.get() + size - 1); |
| 59 | } |
| 60 | /** Wraps a value with angles and returns the string |
| 61 | * |
| 62 | * @param[in] val Value to wrap |