From 7489f40a6b12809928f871daa8ac00e501a3c415 Mon Sep 17 00:00:00 2001 From: arendelle <2381642961@qq.com> Date: Sun, 13 Jul 2025 20:03:54 +0800 Subject: [PATCH 1/3] Suggesting for is_copy_constructible_v in copy constructor ::std::copyable is too strict for copy constructor because it requires both is_copy_constructible_v and ::std::is_copy_assignable_v. A class has copy constructor but disables copy assign operator may sounds weird but it DO troubles me. Therefore, if you agree with me, I'll handle other similar requires. --- include/fast_io_dsal/impl/vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fast_io_dsal/impl/vector.h b/include/fast_io_dsal/impl/vector.h index f0b66dd0..f94b5df5 100644 --- a/include/fast_io_dsal/impl/vector.h +++ b/include/fast_io_dsal/impl/vector.h @@ -397,7 +397,7 @@ class vector FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE } inline constexpr vector(vector const &vec) - requires(::std::copyable) + requires(::std::is_copy_constructible_v) { std::size_t const vecsize{static_cast(vec.imp.curr_ptr - vec.imp.begin_ptr)}; if (vecsize == 0) From 1956206d922a2d79e1979703d2d6ae97a77b65ae Mon Sep 17 00:00:00 2001 From: Arendelle <2381642961@qq.com> Date: Mon, 28 Jul 2025 10:13:31 +0800 Subject: [PATCH 2/3] final fix of fast_io::vector --- include/fast_io_dsal/impl/vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fast_io_dsal/impl/vector.h b/include/fast_io_dsal/impl/vector.h index f94b5df5..e5f81463 100644 --- a/include/fast_io_dsal/impl/vector.h +++ b/include/fast_io_dsal/impl/vector.h @@ -201,7 +201,7 @@ struct vector_internal } // namespace details -template <::std::movable T, typename allocator> +template class vector FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE { public: From 3c2a52bdbba32a6e4d1ea5b9454459e15c49a443 Mon Sep 17 00:00:00 2001 From: Arendelle <2381642961@qq.com> Date: Mon, 28 Jul 2025 13:01:28 +0800 Subject: [PATCH 3/3] Remove some abstract const rvalue ref --- examples/0039.gen_win32_mangling/arm-windows-msvc.cc | 2 +- examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc | 2 +- examples/0039.gen_win32_mangling/common.h | 2 +- examples/0039.gen_win32_mangling/i686-windows-msvc.cc | 4 ++-- examples/0039.gen_win32_mangling/prebuild.cc | 6 +++--- examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/0039.gen_win32_mangling/arm-windows-msvc.cc b/examples/0039.gen_win32_mangling/arm-windows-msvc.cc index 06d784b0..29970b07 100644 --- a/examples/0039.gen_win32_mangling/arm-windows-msvc.cc +++ b/examples/0039.gen_win32_mangling/arm-windows-msvc.cc @@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s bool is_win32_symbols{true}; ::std::size_t symbols_index{}; auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)}; - auto const &&asmfile_size = asmfile.size(); + auto const asmfile_size = asmfile.size(); for (::std::size_t i{}; i < asmfile_size; ++i) { if (asmfile[i + 0] == u8'm' && asmfile[i + 1] == u8'o' && asmfile[i + 2] == u8'v' && asmfile[i + 3] == u8'w') diff --git a/examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc b/examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc index 9ab33162..3d051a21 100644 --- a/examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc +++ b/examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc @@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s bool is_win32_symbols{true}; ::std::size_t symbols_index{}; auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)}; - auto const &&asmfile_size = asmfile.size(); + auto const asmfile_size = asmfile.size(); for (::std::size_t i{}; i < asmfile_size; ++i) { while (asmfile[i] == u8'\t' || asmfile[i] == u8' ' || asmfile[i] == u8'\n') diff --git a/examples/0039.gen_win32_mangling/common.h b/examples/0039.gen_win32_mangling/common.h index f587eb8f..78e8b5b3 100644 --- a/examples/0039.gen_win32_mangling/common.h +++ b/examples/0039.gen_win32_mangling/common.h @@ -12,7 +12,7 @@ inline ::fast_io::vector<::fast_io::u8string> parse_symbols(char8_t const *path) ::fast_io::vector<::fast_io::u8string> result; // TODO native_file_loader do not suppport ::fast_io::string_view ::fast_io::native_file_loader symbols_loader{::fast_io::mnp::os_c_str(path)}; - auto const &&symbols_loader_size = symbols_loader.size(); + auto const symbols_loader_size = symbols_loader.size(); for (::std::size_t i{}; i < symbols_loader_size; ++i) { ::fast_io::u8string tmp{}; diff --git a/examples/0039.gen_win32_mangling/i686-windows-msvc.cc b/examples/0039.gen_win32_mangling/i686-windows-msvc.cc index dc49e37d..ac6a1b6b 100644 --- a/examples/0039.gen_win32_mangling/i686-windows-msvc.cc +++ b/examples/0039.gen_win32_mangling/i686-windows-msvc.cc @@ -9,7 +9,7 @@ inline auto parse_symbols(char8_t const *path) ::fast_io::vector<::fast_io::u8string> result; // TODO native_file_loader do not suppport ::fast_io::string_view ::fast_io::native_file_loader symbols_loader{::fast_io::mnp::os_c_str(path)}; - auto const &&symbols_loader_size = symbols_loader.size(); + auto const symbols_loader_size = symbols_loader.size(); for (::std::size_t i{}; i < symbols_loader_size; ++i) { ::fast_io::u8string tmp{}; @@ -35,7 +35,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s bool is_win32_symbols{true}; ::std::size_t symbols_index{}; auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)}; - auto const &&asmfile_size = asmfile.size(); + auto const asmfile_size = asmfile.size(); for (::std::size_t i{}; i < asmfile_size; ++i) { if (asmfile[i] == u8'c' && asmfile[i + 1] == u8'a' && asmfile[i + 2] == u8'l' && asmfile[i + 3] == u8'l' && asmfile[i + 4] == u8'l') diff --git a/examples/0039.gen_win32_mangling/prebuild.cc b/examples/0039.gen_win32_mangling/prebuild.cc index 6b775113..1d485f1c 100644 --- a/examples/0039.gen_win32_mangling/prebuild.cc +++ b/examples/0039.gen_win32_mangling/prebuild.cc @@ -28,7 +28,7 @@ inline auto gen_apis( { ::fast_io::u8string main_body{}; function_declaration.append(::fast_io::u8concat_fast_io(u8"namespace ", prefix, u8" {\n")); - auto const &&header_size = context.size(); + auto const header_size = context.size(); for (::std::size_t i{}; i < header_size; ++i) { // FAST_IO_DLLIMPORT @@ -189,8 +189,8 @@ int main(int argc, char *const *const argv) ::fast_io::native_mkdirat(::fast_io::at_fdcwd(), "build"); - auto const &&nt_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/nt/nt_api.h"}; - auto const &&win32_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/win32/apis.h"}; + auto const nt_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/nt/nt_api.h"}; + auto const win32_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/win32/apis.h"}; ::fast_io::u8string win32_declaration{}, nt_declaration{}, win32_symbols{}, nt_symbols{}; // process win32 apis.h diff --git a/examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc b/examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc index 906dfe53..3965d18e 100644 --- a/examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc +++ b/examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc @@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s bool is_win32_symbols{true}; ::std::size_t symbols_index{}; auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)}; - auto const &&asmfile_size = asmfile.size(); + auto const asmfile_size = asmfile.size(); for (::std::size_t i{}; i < asmfile_size; ++i) { if (asmfile[i] == u8'c' && asmfile[i + 1] == u8'a' && asmfile[i + 2] == u8'l' && asmfile[i + 3] == u8'l' && asmfile[i + 4] == u8'q')