Псевдоніми типу
Псевдонім типу створює ім’я для іншого типу. Ці два типи можна використовувати взаємозамінно.
Speaker Notes
This slide should take about 2 minutes.
-
A newtype is often a better alternative since it creates a distinct type. Prefer
struct InventoryCount(usize)
totype InventoryCount = usize
. -
Програмісти на C впізнають це як схоже на
typedef
.