From d7ace93f1aa99f0c685b4bad81bb2defd4703f58 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 22 Sep 2026 15:39:52 +0200 Subject: [PATCH] Use casual C++ terminology --- cpp-overload-test/src/stdcpp/forward_list.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cpp-overload-test/src/stdcpp/forward_list.rs b/cpp-overload-test/src/stdcpp/forward_list.rs index 25872aa..075b27e 100644 --- a/cpp-overload-test/src/stdcpp/forward_list.rs +++ b/cpp-overload-test/src/stdcpp/forward_list.rs @@ -43,7 +43,7 @@ impl StdForwardList { StdForwardList(list) } - fn const_lvalue_copy(other: &StdForwardList) -> StdForwardList { + fn copy_from(other: &StdForwardList) -> StdForwardList { let other = other.0 as *const c_void; let list = unsafe { cpp!([other as "const std::forward_list*"] -> *mut c_void as "std::forward_list*" { @@ -54,7 +54,7 @@ impl StdForwardList { StdForwardList(list) } - fn rvalue_copy(other: &mut StdForwardList) -> StdForwardList { + fn move_from(other: &mut StdForwardList) -> StdForwardList { let other: *mut c_void = other.0; let list = unsafe { cpp!([other as "std::forward_list*"] -> *mut c_void as "std::forward_list*" { @@ -87,14 +87,12 @@ overload! { /// Clone a list from a shared reference. fn new(other: &StdForwardList) -> StdForwardList { - StdForwardList::const_lvalue_copy(other) + StdForwardList::copy_from(other) } - /// Clone a list from a mutable reference. - /// Some C++ types use this to extend temporary lifetimes or mutate list objects during - /// copy construction. + /// Move list items from a mutable reference into a new list. fn new(other: &mut StdForwardList) -> StdForwardList { - StdForwardList::rvalue_copy(other) + StdForwardList::move_from(other) } // TODO: