fix the std::formatter for Output_rep

This commit is contained in:
Laurent Rineau 2023-06-28 22:50:18 +02:00
parent 6096748402
commit c2fe3273ff
1 changed files with 4 additions and 2 deletions

View File

@ -1006,8 +1006,10 @@ struct formatter<CGAL::Output_rep<T, F>, CharT> : public std::formatter<std::bas
const auto end = ctx.end(); const auto end = ctx.end();
if(it == end) if(it == end)
return it; return it;
if(*it != CharT('.')) if(*it != CharT('.')) {
return it; if(*it == CharT('}')) return it;
throw std::format_error("formatter for CGAL::Output_rep only support precision, like `{:.6}`");
}
if(++it == end) if(++it == end)
throw std::format_error("Missing precision"); throw std::format_error("Missing precision");
if(*it < CharT('0') || *it > CharT('9')) if(*it < CharT('0') || *it > CharT('9'))