Skip to content

Commit 8cede19

Browse files
committed
Quick fix for an old msvc bug
1 parent fc3ac60 commit 8cede19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/microfmt.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ namespace microfmt {
209209
}
210210
};
211211
for(; it != fmt_end; it++) {
212-
if((*it == '{' || *it == '}') && peek(1) == *it) { // parse {{ and }}}} escapes
212+
if((*it == '{' || *it == '}') && peek(1) == *it) { // parse {{ and }} escapes
213213
it++;
214214
} else if(*it == '{' && it + 1 != fmt_end) {
215215
auto saved_it = it;
@@ -270,8 +270,9 @@ namespace microfmt {
270270
return detail::format<sizeof...(args)>(fmt.begin(), fmt.end(), {detail::format_value(args)...});
271271
}
272272

273+
// working around an old msvc bug https://godbolt.org/z/88T8hrzzq mre: https://godbolt.org/z/drd8echbP
273274
inline std::string format(std::string_view fmt) {
274-
return detail::format<0>(fmt.begin(), fmt.end(), {});
275+
return detail::format<1>(fmt.begin(), fmt.end(), {detail::format_value(1)});
275276
}
276277
#endif
277278

@@ -280,7 +281,6 @@ namespace microfmt {
280281
return detail::format<sizeof...(args)>(fmt, fmt + std::strlen(fmt), {detail::format_value(args)...});
281282
}
282283

283-
// working around an old msvc bug https://godbolt.org/z/88T8hrzzq mre: https://godbolt.org/z/drd8echbP
284284
inline std::string format(const char* fmt) {
285285
return detail::format<1>(fmt, fmt + std::strlen(fmt), {detail::format_value(1)});
286286
}

0 commit comments

Comments
 (0)