File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010#include < cstdint>
1111#include < limits>
1212#include < string_view>
13+ #include < type_traits>
1314#include < array>
14-
1515#include < bid_conf.h>
1616#include < bid_functions.h>
1717#include < dfp754.h>
@@ -382,21 +382,21 @@ namespace math {
382382#undef sigma_stream_op
383383
384384namespace std {
385- template <class T >
386- struct formatter <math::decimal_t <T>> {
387- template <typename ctx_t >
388- constexpr auto parse (ctx_t & ctx) const {
389- return ctx.begin ();
385+ template <typename integral_t >
386+ struct formatter <math::decimal_t <integral_t >, char > {
387+ formatter<std::string_view, char > delegate;
388+
389+ constexpr auto parse (std::format_parse_context& ctx) {
390+ return delegate.parse (ctx);
390391 }
391392
392- template <typename ctx_t >
393- auto format (const math::decimal_t <T>& dec, ctx_t & ctx) const {
394- return std::format_to (ctx.out (), " {}" , static_cast <std::string>(dec));
393+ template <typename format_context_t >
394+ auto format (const math::decimal_t <integral_t >& value, format_context_t & ctx) const {
395+ const std::string text = static_cast <std::string>(value);
396+ return delegate.format (std::string_view{text}, ctx);
395397 }
396398 };
397- } // namespace std
398-
399-
399+ }
400400namespace math {
401401 /*
402402 intel_bid_prefixes := {__bid32_ __bid64_ __bid128_}
You can’t perform that action at this time.
0 commit comments