diff --git a/include/boost/parser/detail/text/config.hpp b/include/boost/parser/detail/text/config.hpp index ec353047..b96fa237 100644 --- a/include/boost/parser/detail/text/config.hpp +++ b/include/boost/parser/detail/text/config.hpp @@ -18,15 +18,6 @@ # define BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS 1 #endif -// GCC 12 claims to support 201907L <= __cpp_deduction_guides, but does not. -#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS && defined(__cpp_deduction_guides) && \ - 201907L <= __cpp_deduction_guides && (!defined(__GNUC__) || 13 <= __GNUC__) && \ - !defined(_MSC_VER) -#define BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD 1 -#else -#define BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD 0 -#endif - #if BOOST_PARSER_USE_CONCEPTS namespace boost::parser::detail { namespace text { namespace detail { inline constexpr auto begin = std::ranges::begin; diff --git a/include/boost/parser/detail/text/transcode_iterator_fwd.hpp b/include/boost/parser/detail/text/transcode_iterator_fwd.hpp index 54721d61..e44a1d90 100644 --- a/include/boost/parser/detail/text/transcode_iterator_fwd.hpp +++ b/include/boost/parser/detail/text/transcode_iterator_fwd.hpp @@ -51,51 +51,6 @@ namespace boost::parser::detail { namespace text { #endif class utf_iterator; -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - - template< - utf8_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_8_to_16_iterator = - utf_iterator; - template< - utf16_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_16_to_8_iterator = - utf_iterator; - - - template< - utf8_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_8_to_32_iterator = - utf_iterator; - template< - utf32_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_32_to_8_iterator = - utf_iterator; - - - template< - utf16_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_16_to_32_iterator = - utf_iterator; - template< - utf32_iter I, - std::sentinel_for S = I, - transcoding_error_handler ErrorHandler = use_replacement_character> - using utf_32_to_16_iterator = - utf_iterator; - -#endif - }} #endif diff --git a/include/boost/parser/detail/text/transcode_view.hpp b/include/boost/parser/detail/text/transcode_view.hpp index a25530d2..10ae3219 100644 --- a/include/boost/parser/detail/text/transcode_view.hpp +++ b/include/boost/parser/detail/text/transcode_view.hpp @@ -266,11 +266,6 @@ namespace boost::parser::detail { namespace text { { return y.end_ - x.it_; } }; -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - template - project_view(R &&) -> project_view, F>; -#endif - namespace detail { #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS template @@ -293,11 +288,7 @@ namespace boost::parser::detail { namespace text { #endif [[nodiscard]] constexpr auto operator()(R && r) const { -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - return project_view_type(std::forward(r)); -#else return project_view_type(std::forward(r)); -#endif } }; } @@ -309,17 +300,6 @@ namespace boost::parser::detail { namespace text { #endif constexpr detail::project_impl project{}; -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - - template - using char8_view = project_view{}>; - template - using char16_view = project_view{}>; - template - using char32_view = project_view{}>; - -#else - #if defined(__cpp_char8_t) #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS template @@ -399,8 +379,6 @@ namespace boost::parser::detail { namespace text { char16_view(R &&) -> char16_view>; template char32_view(R &&) -> char32_view>; -#endif - #endif namespace detail { @@ -610,20 +588,6 @@ namespace boost::parser::detail { namespace text { }; -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - - template - utf_view(R &&) -> utf_view>; - - template - using utf8_view = utf_view; - template - using utf16_view = utf_view; - template - using utf32_view = utf_view; - -#else - #if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS template requires std::ranges::view @@ -679,16 +643,12 @@ namespace boost::parser::detail { namespace text { {} }; -#if !BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD template utf8_view(R &&) -> utf8_view>; template utf16_view(R &&) -> utf16_view>; template utf32_view(R &&) -> utf32_view>; -#endif - -#endif #if defined(BOOST_TEXT_DOXYGEN) @@ -821,7 +781,6 @@ namespace std::ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range; -#if !BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; @@ -831,7 +790,6 @@ namespace std::ranges { template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; -#endif } #endif diff --git a/include/boost/parser/transcode_view.hpp b/include/boost/parser/transcode_view.hpp index 2a43b1f2..a242a900 100644 --- a/include/boost/parser/transcode_view.hpp +++ b/include/boost/parser/transcode_view.hpp @@ -13,17 +13,6 @@ namespace boost::parser { using format = detail::text::format; -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - - template - using utf8_view = detail::text::utf_view; - template - using utf16_view = detail::text::utf_view; - template - using utf32_view = detail::text::utf_view; - -#else - /** A view that produces UTF-8 from an given sequence of UTF. \tparam V Constrained by `std::ranges::view`. Additionally, the @@ -103,8 +92,6 @@ namespace boost::parser { utf16_view(R &&) -> utf16_view>; template utf32_view(R &&) -> utf32_view>; -#endif - #endif /** A view adaptor that produces a `utf8_view` of the given view. */ diff --git a/test/transform_replace.cpp b/test/transform_replace.cpp index 9f2af917..726e5005 100644 --- a/test/transform_replace.cpp +++ b/test/transform_replace.cpp @@ -201,13 +201,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u8_u16_shim(f_u16str); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u8_u16_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf8, - std::ranges::owning_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u8_u16_shim), std::u8string, @@ -215,13 +208,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u8_u16_ref_shim(f_u16str_ref); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u8_u16_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf8, - std::ranges::ref_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u8_u16_ref_shim), std::u8string, @@ -231,13 +217,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u8_u32_shim(f_u32str); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u8_u32_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf8, - std::ranges::owning_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u8_u32_shim), std::u8string, @@ -245,13 +224,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u8_u32_ref_shim(f_u32str_ref); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u8_u32_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf8, - std::ranges::ref_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u8_u32_ref_shim), std::u8string, @@ -261,13 +233,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u16_u8_shim(f_u8str); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u16_u8_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf16, - std::ranges::owning_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u16_u8_shim), std::u16string, @@ -275,13 +240,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u16_u8_ref_shim(f_u8str_ref); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u16_u8_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf16, - std::ranges::ref_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u16_u8_ref_shim), std::u16string, @@ -291,13 +249,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u32_u8_shim(f_u8str); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u32_u8_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf32, - std::ranges::owning_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u32_u8_shim), std::u32string, @@ -305,13 +256,6 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u32_u8_ref_shim(f_u8str_ref); -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u32_u8_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf32, - std::ranges::ref_view> &>); -#endif static_assert(bp::detail::transform_replacement_for< decltype(u32_u8_ref_shim), std::u32string, @@ -341,15 +285,7 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u16_u32_shim(f_u32str); -#if BOOST_PARSER_USE_CONCEPTS -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u16_u32_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf16, - std::ranges::owning_view> &>); -#endif -#else +#if !BOOST_PARSER_USE_CONCEPTS static_assert( std::is_same_v< decltype(u16_u32_shim(attr_t{})), @@ -363,15 +299,7 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u16_u32_ref_shim(f_u32str_ref); -#if BOOST_PARSER_USE_CONCEPTS -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u16_u32_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf16, - std::ranges::ref_view> &>); -#endif -#else +#if !BOOST_PARSER_USE_CONCEPTS static_assert(std::is_same_v< decltype(u16_u32_ref_shim(attr_t{})), bp::detail::text::utf16_view< @@ -406,15 +334,7 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u32_u16_shim(f_u16str); -#if BOOST_PARSER_USE_CONCEPTS -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u32_u16_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf32, - std::ranges::owning_view> &>); -#endif -#else +#if !BOOST_PARSER_USE_CONCEPTS static_assert( std::is_same_v< decltype(u32_u16_shim(attr_t{})), @@ -428,15 +348,7 @@ namespace detail_utf_rvalue_shim { bp::detail::utf_rvalue_shim u32_u16_ref_shim(f_u16str_ref); -#if BOOST_PARSER_USE_CONCEPTS -#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD - static_assert(std::is_same_v< - decltype(u32_u16_ref_shim(attr_t{})), - bp::detail::text::utf_view< - bp::detail::text::format::utf32, - std::ranges::ref_view> &>); -#endif -#else +#if !BOOST_PARSER_USE_CONCEPTS static_assert(std::is_same_v< decltype(u32_u16_ref_shim(attr_t{})), bp::detail::text::utf32_view<