From 88a7b39dc2c41768ade1ea6eae1ac9e3703d5fae Mon Sep 17 00:00:00 2001 From: Zach Laine Date: Thu, 21 Dec 2023 23:29:59 -0600 Subject: [PATCH] Fix MSVC 2022 in C++20 mode. --- .../parser/detail/text/transcode_iterator.hpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/include/boost/parser/detail/text/transcode_iterator.hpp b/include/boost/parser/detail/text/transcode_iterator.hpp index 424341c2..359087af 100644 --- a/include/boost/parser/detail/text/transcode_iterator.hpp +++ b/include/boost/parser/detail/text/transcode_iterator.hpp @@ -947,12 +947,22 @@ namespace boost::parser::detail { namespace text { { return *it == detail::iter_value_t{}; } -#if !BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS +#if !defined(__cpp_impl_three_way_comparison) + template + friend constexpr auto operator==(null_sentinel_t, I it) + { + return *it == detail::iter_value_t{}; + } template friend constexpr auto operator!=(I it, null_sentinel_t) { return *it != detail::iter_value_t{}; } + template + friend constexpr auto operator!=(null_sentinel_t, I it) + { + return *it != detail::iter_value_t{}; + } #endif }; @@ -2773,8 +2783,8 @@ namespace boost::parser::detail { namespace text { } } -#if !BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS - friend constexpr bool operator!=( +#if !defined(__cpp_impl_three_way_comparison) + friend BOOST_PARSER_CONSTEXPR bool operator!=( std::enable_if_t, utf_iterator> lhs, utf_iterator rhs) { return !(lhs == rhs); } #endif @@ -2794,8 +2804,8 @@ namespace boost::parser::detail { namespace text { } } -#if !BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS - friend constexpr bool operator!=(utf_iterator lhs, S rhs) +#if !defined(__cpp_impl_three_way_comparison) + friend BOOST_PARSER_CONSTEXPR bool operator!=(utf_iterator lhs, S rhs) { return !(lhs == rhs); } #endif