|
18 | 18 |
|
19 | 19 | #if _HAS_CXX23 |
20 | 20 | #include <__msvc_ranges_to.hpp> |
| 21 | +#include <format> |
21 | 22 | #include <iterator> |
22 | 23 | #endif // _HAS_CXX23 |
23 | 24 |
|
@@ -223,6 +224,14 @@ void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcep |
223 | 224 | template <class _Ty, class _Container, class _Alloc> |
224 | 225 | struct uses_allocator<queue<_Ty, _Container>, _Alloc> : uses_allocator<_Container, _Alloc>::type {}; |
225 | 226 |
|
| 227 | +#if _HAS_CXX23 |
| 228 | +// Per LWG-3997, `_CharT` in library-provided `formatter` specializations is |
| 229 | +// constrained to character types supported by `format`. |
| 230 | +template <_Format_supported_charT _CharT, class _Ty, formattable<_CharT> _Container> |
| 231 | +struct formatter<queue<_Ty, _Container>, _CharT> |
| 232 | + : _Adaptor_formatter_base<queue<_Ty, _Container>, _CharT, _RANGES ref_view> {}; |
| 233 | +#endif // _HAS_CXX23 |
| 234 | + |
226 | 235 | _EXPORT_STD template <class _Ty, class _Container = vector<_Ty>, class _Pr = less<typename _Container::value_type>> |
227 | 236 | class priority_queue { |
228 | 237 | public: |
@@ -490,6 +499,13 @@ void swap(priority_queue<_Ty, _Container, _Pr>& _Left, priority_queue<_Ty, _Cont |
490 | 499 | template <class _Ty, class _Container, class _Pr, class _Alloc> |
491 | 500 | struct uses_allocator<priority_queue<_Ty, _Container, _Pr>, _Alloc> : uses_allocator<_Container, _Alloc>::type {}; |
492 | 501 |
|
| 502 | +#if _HAS_CXX23 |
| 503 | +// Per LWG-3997, `_CharT` in library-provided `formatter` specializations is |
| 504 | +// constrained to character types supported by `format`. |
| 505 | +template <_Format_supported_charT _CharT, class _Ty, formattable<_CharT> _Container, class _Comp> |
| 506 | +struct formatter<priority_queue<_Ty, _Container, _Comp>, _CharT> |
| 507 | + : _Adaptor_formatter_base<priority_queue<_Ty, _Container, _Comp>, _CharT, _RANGES ref_view> {}; |
| 508 | +#endif // _HAS_CXX23 |
493 | 509 | _STD_END |
494 | 510 |
|
495 | 511 | #pragma pop_macro("new") |
|
0 commit comments