Skip to content

Commit

Permalink
Quick fix for an old msvc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Jun 2, 2024
1 parent fc3ac60 commit 8cede19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/microfmt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace microfmt {
}
};
for(; it != fmt_end; it++) {
if((*it == '{' || *it == '}') && peek(1) == *it) { // parse {{ and }}}} escapes
if((*it == '{' || *it == '}') && peek(1) == *it) { // parse {{ and }} escapes
it++;
} else if(*it == '{' && it + 1 != fmt_end) {
auto saved_it = it;
Expand Down Expand Up @@ -270,8 +270,9 @@ namespace microfmt {
return detail::format<sizeof...(args)>(fmt.begin(), fmt.end(), {detail::format_value(args)...});
}

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

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

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

0 comments on commit 8cede19

Please sign in to comment.