You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to support some sort of precision specifications without reinventing the wheel for my user defined formatter...
After having opened the hood to see how you were doing it. I ended up with:
constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin())
{
auto it = ctx.begin(), end = ctx.end();
if (it != end) {
if (*it == 'm') {
m_type = MAXIMUM;
++it;
} else if (*it == '.') {
m_type = CUSTOM;
it = detail::parse_precision(it, end, Handler<ParseContext>{ctx, m_specs});
if (it == end) return it;
}
}
// Check if reached the end of the range:
if (it != end && *it != '}') throw format_error("invalid format");
// Return an iterator past the end of the parsed range:
return it;
}
I am pretty sure that a lot of people would appreciate if detail::parse_precision() and others would be easily available to them...
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. This and related documentation improvements are already tracked in #2086 and will hopefully be addressed in one of the upcoming versions.
I wanted to support some sort of precision specifications without reinventing the wheel for my user defined formatter...
After having opened the hood to see how you were doing it. I ended up with:
I am pretty sure that a lot of people would appreciate if detail::parse_precision() and others would be easily available to them...
The text was updated successfully, but these errors were encountered: