Rust for C++

Drop

Rust
impl Drop for Block {
    fn drop(&mut self) {
        println!("Dropping!");
    }
}

Run

C++
~Block() {
    cout << "delete!" << endl;
}

Run