Add a std::formatter specialization for core::string_view. Fixes #190.

This commit is contained in:
Peter Dimov
2025-06-25 17:11:26 +03:00
parent 16d8f5f8ff
commit 65337d1af8

View File

@@ -34,6 +34,9 @@
#if !defined(BOOST_NO_CXX20_HDR_CONCEPTS) // std::common_reference_with
# include <type_traits>
#endif
#if !defined(BOOST_NO_CXX20_HDR_FORMAT)
# include <format> // std::formatter
#endif
namespace boost
{
@@ -1261,4 +1264,15 @@ struct std::basic_common_reference<
#endif
// std::format support
#if !defined(BOOST_NO_CXX20_HDR_FORMAT)
template<class Ch, class Ch2>
struct std::formatter<boost::core::basic_string_view<Ch>, Ch2>: std::formatter<std::basic_string_view<Ch>, Ch2>
{
};
#endif
#endif // #ifndef BOOST_CORE_STRING_VIEW_HPP_INCLUDED