| 120 | |
| 121 | template<typename T, class... Args> |
| 122 | constexpr void Formatter(string& buffer, |
| 123 | std::string_view v, |
| 124 | const T& t, |
| 125 | const Args&... args) |
| 126 | { |
| 127 | using PT = std::remove_cv_t<T>; |
| 128 | |
| 129 | if constexpr(std::is_same_v<int, PT>) { |
| 130 | if('d' != v[0]) { throw int{3}; } |
| 131 | buffer.append(itoa(t)); |
| 132 | |
| 133 | } else if constexpr(std::is_convertible_v<PT, std::string_view>) { |
| 134 | if('s' != v[0]) { throw int{4}; } |
| 135 | buffer.append(t); |
| 136 | |
| 137 | } else { |
| 138 | throw int{6}; |
| 139 | } |
| 140 | |
| 141 | v.remove_prefix(1); |
| 142 | |
| 143 | if constexpr(sizeof...(Args) > 0) { |
| 144 | Formatter<Args...>(buffer, v, args...); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | template<class... Args> |
| 149 | struct basic_format_string { |
no test coverage detected