about
04/28/2022
RustBites - LifeCycle
Key Commands | |
Esc | toggle menus |
R | Refresh |
N | Next Page |
P | Prev Page |
B | Back |
F | Forward |
T | scroll to top |
E | scroll to end |
H | Home |
M | SiteMap |
X | Explorer |
S | page sections |
K | keys |
A | about |
I | increase font 22px |
U | usual font 18px |
D | decrease font 12px |
Rust Bite - LifeCycle
Creation, drop, order of destruction, move
default constructor provides object with default state | |
parameterized constructdor provides object with program supplied state | |
clone function, e.g., copy constructor makes a new object that is a copy of cloned | |
drop function, e.g., destructor, releases resources held by object when it goes out of scope | |
value getter returns object's state |
Test Code
![]() |
![]() |
Demonstrate Creation and Drop
![]() |
![]() |
Demonstrate Order of Destruction
![]() |
![]() |
Demonstrate Collecton Creation and Drop
![]() |
![]() |
Demonstrate Move
![]() |
![]() |