... | ... | @@ -97,17 +97,18 @@ checklist](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/classChecklistCross |
|
|
| C++ | Java | Python 3 | Rust |
|
|
|
| :------------------------ | :------------------------------ | :--------------- | :---- |
|
|
|
| Default Constructor | Default Constructor | `__init__` | `new()` or Default trait |
|
|
|
| Copy Constructor | Clone and/or Copy Constructor | `__deepcopy__` | Clone trait |
|
|
|
| Copy Constructor | Clone and/or Copy Constructor | `__deepcopy__` | `Clone` trait |
|
|
|
| Destructor | | | |
|
|
|
| | finalize (deprecated/discouraged) | `__del__` | Drop trait |
|
|
|
| | finalize (deprecated/discouraged) | `__del__` | `Drop` trait |
|
|
|
| Assignment Operator (=) | | | |
|
|
|
| Accessors (Getters) | Accessors (Getters) | Accessors (`@property`) | Accessors (Getters) |
|
|
|
| Mutators (Setters) | Mutators (Setters) | Setter (`@attribute.setter`) | Mutators (setters) |
|
|
|
| Swap | | | |
|
|
|
| Logical Equivalence Operator (==) | equals | `__eq__` | std::cmp::PartialEq trait |
|
|
|
| Less-Than / Comes-Before Operator (<) | hashCode | `__hash__` | std::cmp::PartialOrd trait |
|
|
|
| Stream Insertion Operator (<<) | toString | `__str__` | std::fmt::Display trait |
|
|
|
| | | `__repr__` | std::fmt::Debug trait |
|
|
|
| Logical Equivalence Operator (==) | equals | `__eq__` | `std::cmp::PartialEq` trait |
|
|
|
| Less-Than / Comes-Before Operator (<) | hashCode | `__hash__` | `std::cmp::PartialOrd` trait |
|
|
|
| `std::hash` *(actual hashing)* | hashCode | `__hash__` | `std::hash::Hash` trait |
|
|
|
| Stream Insertion Operator (<<) | toString | `__str__` | `std::fmt::Display` trait |
|
|
|
| | | `__repr__` | `std::fmt::Debug` trait |
|
|
|
| `begin()` and `end()` | `iterator` | `__iter__` | `iter()` and `iter_mut()` |
|
|
|
|
|
|
|
... | ... | |