Skip to content

Commit b0b2e1d

Browse files
GoodenoughPhysicsLabarendelle
andauthored
Suggesting for using is_copy_constructible_v in copy constructor (#1180)
* 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. * final fix of fast_io::vector * Remove some abstract const rvalue ref --------- Co-authored-by: arendelle <[email protected]>
1 parent 5017521 commit b0b2e1d

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

examples/0039.gen_win32_mangling/arm-windows-msvc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s
66
bool is_win32_symbols{true};
77
::std::size_t symbols_index{};
88
auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)};
9-
auto const &&asmfile_size = asmfile.size();
9+
auto const asmfile_size = asmfile.size();
1010
for (::std::size_t i{}; i < asmfile_size; ++i)
1111
{
1212
if (asmfile[i + 0] == u8'm' && asmfile[i + 1] == u8'o' && asmfile[i + 2] == u8'v' && asmfile[i + 3] == u8'w')

examples/0039.gen_win32_mangling/arm64ec-windows-msvc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s
66
bool is_win32_symbols{true};
77
::std::size_t symbols_index{};
88
auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)};
9-
auto const &&asmfile_size = asmfile.size();
9+
auto const asmfile_size = asmfile.size();
1010
for (::std::size_t i{}; i < asmfile_size; ++i)
1111
{
1212
while (asmfile[i] == u8'\t' || asmfile[i] == u8' ' || asmfile[i] == u8'\n')

examples/0039.gen_win32_mangling/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inline ::fast_io::vector<::fast_io::u8string> parse_symbols(char8_t const *path)
1212
::fast_io::vector<::fast_io::u8string> result;
1313
// TODO native_file_loader do not suppport ::fast_io::string_view
1414
::fast_io::native_file_loader symbols_loader{::fast_io::mnp::os_c_str(path)};
15-
auto const &&symbols_loader_size = symbols_loader.size();
15+
auto const symbols_loader_size = symbols_loader.size();
1616
for (::std::size_t i{}; i < symbols_loader_size; ++i)
1717
{
1818
::fast_io::u8string tmp{};

examples/0039.gen_win32_mangling/i686-windows-msvc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inline auto parse_symbols(char8_t const *path)
99
::fast_io::vector<::fast_io::u8string> result;
1010
// TODO native_file_loader do not suppport ::fast_io::string_view
1111
::fast_io::native_file_loader symbols_loader{::fast_io::mnp::os_c_str(path)};
12-
auto const &&symbols_loader_size = symbols_loader.size();
12+
auto const symbols_loader_size = symbols_loader.size();
1313
for (::std::size_t i{}; i < symbols_loader_size; ++i)
1414
{
1515
::fast_io::u8string tmp{};
@@ -35,7 +35,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s
3535
bool is_win32_symbols{true};
3636
::std::size_t symbols_index{};
3737
auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)};
38-
auto const &&asmfile_size = asmfile.size();
38+
auto const asmfile_size = asmfile.size();
3939
for (::std::size_t i{}; i < asmfile_size; ++i)
4040
{
4141
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')

examples/0039.gen_win32_mangling/prebuild.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inline auto gen_apis(
2828
{
2929
::fast_io::u8string main_body{};
3030
function_declaration.append(::fast_io::u8concat_fast_io(u8"namespace ", prefix, u8" {\n"));
31-
auto const &&header_size = context.size();
31+
auto const header_size = context.size();
3232
for (::std::size_t i{}; i < header_size; ++i)
3333
{
3434
// FAST_IO_DLLIMPORT
@@ -189,8 +189,8 @@ int main(int argc, char *const *const argv)
189189

190190
::fast_io::native_mkdirat(::fast_io::at_fdcwd(), "build");
191191

192-
auto const &&nt_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/nt/nt_api.h"};
193-
auto const &&win32_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/win32/apis.h"};
192+
auto const nt_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/nt/nt_api.h"};
193+
auto const win32_header = ::fast_io::native_file_loader{"../../include/fast_io_hosted/platforms/win32/apis.h"};
194194

195195
::fast_io::u8string win32_declaration{}, nt_declaration{}, win32_symbols{}, nt_symbols{};
196196
// process win32 apis.h

examples/0039.gen_win32_mangling/x86_64-windows-msvc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inline auto gen_pragmas(char8_t const *asmpath, ::fast_io::vector<::fast_io::u8s
66
bool is_win32_symbols{true};
77
::std::size_t symbols_index{};
88
auto asmfile = ::fast_io::native_file_loader{::fast_io::mnp::os_c_str(asmpath)};
9-
auto const &&asmfile_size = asmfile.size();
9+
auto const asmfile_size = asmfile.size();
1010
for (::std::size_t i{}; i < asmfile_size; ++i)
1111
{
1212
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')

include/fast_io_dsal/impl/vector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct vector_internal
201201

202202
} // namespace details
203203

204-
template <::std::movable T, typename allocator>
204+
template <typename T, typename allocator>
205205
class vector FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE
206206
{
207207
public:
@@ -397,7 +397,7 @@ class vector FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE
397397
}
398398

399399
inline constexpr vector(vector const &vec)
400-
requires(::std::copyable<value_type>)
400+
requires(::std::is_copy_constructible_v<value_type>)
401401
{
402402
std::size_t const vecsize{static_cast<std::size_t>(vec.imp.curr_ptr - vec.imp.begin_ptr)};
403403
if (vecsize == 0)

0 commit comments

Comments
 (0)