Rust for C++

Clone

Rust
impl Clone for Block {
    fn clone(&self) -> Self {
        Block{number: self.number.clone()}
    }
}

Run

C++
Block(const Block &other) {
    number  = new int;
    *number = *(other.number);
}

Run