Move Constructors: Is it Possible?
summary
Claims that C++-style move constructors and general constructors can be expressed in Rust by reinterpreting Pin guarantees, exposing constructor traits (new, clone_new, move_new), a slot/in_place API and a moveref type to initialize or relocate address-sensitive data without breaking safety. Implements this in the move-it crate with a working, move-respecting Vec prototype, enables return-by-move and collection resizing on stable Rust, and relies on macros to hide unsafe boilerplate.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:47Selfreferential Types
- 3:41Pins
- 5:58Unsafe Code
- 7:22C
- 11:05Return Slot
- 12:41Constructor Slots
- 15:05Copy Constructor
- 16:36MoveRef Constructor
- 17:31Copy Constructors
- 18:48Move Constructors
- 19:47Macros
related talks
01h 02mBack to Basics: C++ Move Semantics
01h 29mA Friendly Introduction to Rust for C++ Developers
08mTrivially Relocatable
01h 04mBack to Basics: Move Semantics
59mRust for C++ developers - What you need to know to get rolling with crates
01h 06mThe Hidden Secrets of Move Semantics
06mLightning Talk: Writing a Better std::move
04m(don't) Copy Paste All The Things
