A newtype is a struct with a single field, struct Metres(f64);, that gives an existing type a new name and a new set of operations: those implemented for it, and no others.
书籍暂未推出简体中文版——当前显示英文版。
Computer Science · 术语表
书籍暂未推出简体中文版——当前显示英文版。
Computer Science · 术语表
A newtype is a struct with a single field, struct Metres(f64);, that gives an existing type a new name and a new set of operations: those implemented for it, and no others.