Skip to content

Commit 236e77c

Browse files
committed
[skip ci] implement trivial copyable type for deque's copy constructor
1 parent 25281f7 commit 236e77c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

include/fast_io_dsal/impl/deque.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,8 @@ inline constexpr void deque_clone_trivial_impl(dequecontroltype &controller, deq
904904
controller.front_block.end_ptr =
905905
::fast_io::freestanding::non_overlapped_copy(fromcontroller.front_block.curr_ptr,
906906
fromcontroller.front_block.end_ptr,
907-
pos + controller.front_block.begin_ptr);
907+
(controller.front_block.curr_ptr =
908+
pos + controller.front_block.begin_ptr));
908909
++destit;
909910
for (begin_ptrtype *it{front_controller_ptr + 1}, *ed{back_controller_ptr}; it != ed; ++it)
910911
{

tests/0026.container/0003.deque/constructors/copy_constructor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ inline void test_copy_constructor()
2424

2525
// Copy construct
2626
::fast_io::deque<T> dq2(dq);
27-
27+
::fast_io::io::println("dq2.size()=",dq2.size(),"\t"
28+
"dq.size()=",dq.size());
2829
// Size must match
2930
if (dq2.size() != dq.size())
3031
{

0 commit comments

Comments
 (0)