From c07fba735ee8389d328103c10ce9a8d49f345060 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Thu, 2 Nov 2023 18:23:06 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Repair=20usage=20of=20cv=5Fvalue?= =?UTF-8?q?=5Ftype=20->=20element=5Ftype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 - .../source/api/encodings/shift_jis_x0208.rst | 7 ++++--- include/ztd/text/any_encoding_with.hpp | 12 ++++++------ include/ztd/text/decode.hpp | 4 ++-- include/ztd/text/detail/span_reconstruct.hpp | 4 ++-- include/ztd/text/shift_jis_x0208.hpp | 8 +++++++- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd8e1c89..607394b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,6 @@ if(ZTD_TEXT_SCRATCH) target_link_libraries(scratch PRIVATE ztd::text - ztd::text::benchmarks::barrier ) target_include_directories(scratch PRIVATE tests/shared/include) target_compile_options(scratch diff --git a/documentation/source/api/encodings/shift_jis_x0208.rst b/documentation/source/api/encodings/shift_jis_x0208.rst index 202f85af..e9f59d07 100644 --- a/documentation/source/api/encodings/shift_jis_x0208.rst +++ b/documentation/source/api/encodings/shift_jis_x0208.rst @@ -44,14 +44,15 @@ Aliases .. doxygenvariable:: ztd::text::shift_jis_x0208 -.. doxygentypedef:: ztd::text::shift_jis +.. doxygenvariable:: ztd::text::shift_jis +.. doxygentypedef:: ztd::text::shift_jis_t + +.. doxygentypedef:: ztd::text::basic_shift_jis Base Templates -------------- -.. doxygentypedef:: ztd::text::basic_shift_jis - .. doxygenclass:: ztd::text::basic_shift_jis_x0208 :members: diff --git a/include/ztd/text/any_encoding_with.hpp b/include/ztd/text/any_encoding_with.hpp index a3efb15f..42b175f1 100644 --- a/include/ztd/text/any_encoding_with.hpp +++ b/include/ztd/text/any_encoding_with.hpp @@ -595,16 +595,16 @@ namespace ztd { namespace text { __real_decode_state& __actual_decode_state = this->_M_get_state(__state); auto& __encoding = this->_M_get_encoding(); if constexpr (is_detected_v<__txt_detail::__detect_adl_internal_text_count_as_decoded_one, - _Encoding, _DecodeCodeUnits, __decode_error_handler, __real_decode_state>) { - auto __raw_result = text_count_as_decoded_one(::ztd::tag<_Encoding> {}, __encoding, - ::std::move(__input), __error_handler, __actual_decode_state); + _DecodeCodeUnits, _Encoding, __decode_error_handler, __real_decode_state>) { + auto __raw_result = text_count_as_decoded_one(::ztd::tag<_Encoding> {}, ::std::move(__input), + __encoding, __error_handler, __actual_decode_state); return __count_as_decoded_result(::std::move(__raw_result.input), __raw_result.count, __state, __raw_result.error_code, __raw_result.error_count); } else if constexpr (is_detected_v<__txt_detail::__detect_adl_internal_text_count_as_decoded_one, - _Encoding, _DecodeCodeUnits, __decode_error_handler, __real_decode_state>) { - auto __raw_result = __text_count_as_decoded_one(::ztd::tag<_Encoding> {}, __encoding, - ::std::move(__input), __error_handler, __actual_decode_state); + _DecodeCodeUnits, _Encoding, __decode_error_handler, __real_decode_state>) { + auto __raw_result = __text_count_as_decoded_one(::ztd::tag<_Encoding> {}, ::std::move(__input), + __encoding, __error_handler, __actual_decode_state); return __count_as_decoded_result(::std::move(__raw_result.input), __raw_result.count, __state, __raw_result.error_code, __raw_result.error_count); } diff --git a/include/ztd/text/decode.hpp b/include/ztd/text/decode.hpp index b4d81c8f..ab1a53a7 100644 --- a/include/ztd/text/decode.hpp +++ b/include/ztd/text/decode.hpp @@ -291,8 +291,8 @@ namespace ztd { namespace text { using _Output = ::ztd::span<_IntermediateValueType>; using _Result = decltype(__encoding.decode_one( ::std::declval<_IntermediateInput>(), ::std::declval<_Output>(), __error_handler, __state)); - using _WorkingInput = __span_reconstruct_t().input), - decltype(::std::declval<_Result>().input)>; + using _ResultInput = decltype(::std::declval<_Result>().input); + using _WorkingInput = __span_reconstruct_t<_ResultInput, _ResultInput>; static_assert(__txt_detail::__is_decode_lossless_or_deliberate_v<_Encoding, _ErrorHandler>, ZTD_TEXT_LOSSY_DECODE_MESSAGE_I_); diff --git a/include/ztd/text/detail/span_reconstruct.hpp b/include/ztd/text/detail/span_reconstruct.hpp index 93d56109..ed0197e1 100644 --- a/include/ztd/text/detail/span_reconstruct.hpp +++ b/include/ztd/text/detail/span_reconstruct.hpp @@ -66,7 +66,7 @@ namespace ztd { namespace text { ::std::in_place_type<_UInputTag>, ::std::forward<_Input>(__input)); } else if constexpr (::ztd::is_span_v<_UInput>) { - using _Ty = ::std::conditional_t<_Mutable, ::ztd::ranges::range_cv_value_type_t<_UInput>, + using _Ty = ::std::conditional_t<_Mutable, typename _UInput::element_type, const typename _UInput::value_type>; return ::ztd::span<_Ty, _UInput::extent>(__input); } @@ -87,7 +87,7 @@ namespace ztd { namespace text { } else { if constexpr (ranges::is_range_contiguous_range_v<_CVInput> && ranges::is_sized_range_v<_CVInput>) { - using _Ty = ::ztd::ranges::range_cv_value_type_t<_CVInput>; + using _Ty = ::ztd::ranges::range_element_type_t<_CVInput>; return ::ztd::ranges::reconstruct( ::std::in_place_type<::ztd::span<_Ty>>, ::std::forward<_Input>(__input)); } diff --git a/include/ztd/text/shift_jis_x0208.hpp b/include/ztd/text/shift_jis_x0208.hpp index ea3f2be0..9a022aa1 100644 --- a/include/ztd/text/shift_jis_x0208.hpp +++ b/include/ztd/text/shift_jis_x0208.hpp @@ -422,13 +422,19 @@ namespace ztd { namespace text { } }; - template + ////// + /// @brief A convenience alais that defaults `basic_shift_jis` to the x0208 version. + template using basic_shift_jis = basic_shift_jis_x0208<_CodeUnit, _CodePoint>; ////// /// @brief An instance of basic_shift_jis_x0208 for ease of use. inline constexpr basic_shift_jis_x0208 shift_jis_x0208 = {}; + ////// + /// @brief A convenience alais that defaults `shift_jis` to the x0208 version. + using shift_jis_t = basic_shift_jis_x0208; + ////// /// @brief An instance of basic_shift_jis for ease of use. inline constexpr auto& shift_jis = shift_jis_x0208;