Skip to content

Commit 3b1df75

Browse files
committed
Add second template parameter
1 parent cfa8775 commit 3b1df75

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/boost/decimal/format.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ inline constexpr bool is_formattable_character_type_v = formattable_character_ty
178178

179179
namespace std {
180180

181-
template <boost::decimal::detail::concepts::decimal_floating_point_type T>
182-
struct formatter<T>
181+
template <boost::decimal::detail::concepts::decimal_floating_point_type T, typename CharT>
182+
requires boost::decimal::detail::is_formattable_character_type_v<CharT>
183+
struct formatter<T, CharT>
183184
{
184185
boost::decimal::chars_format fmt;
185186
boost::decimal::detail::format_sign_option sign;
@@ -196,11 +197,8 @@ struct formatter<T>
196197
use_locale(false)
197198
{}
198199

199-
template <typename CharType>
200-
constexpr auto parse(basic_format_parse_context<CharType>& ctx)
200+
constexpr auto parse(basic_format_parse_context<CharT>& ctx)
201201
{
202-
static_assert(boost::decimal::detail::is_formattable_character_type_v<CharType>, "This is an unsupported character type. Only the following can be used: char, char8_t, char16_t, char32_t, or wchar_t");
203-
204202
const auto res {boost::decimal::detail::parse_impl(ctx)};
205203

206204
ctx_precision = std::get<0>(res);

0 commit comments

Comments
 (0)