而Rust泛型是静态分派,它在编译期间会代码膨胀,将泛型参数转变为使用到的每种具体类型。 ... sharps[1].get_area()); } trait Area{ fn get_area(&self)->f64; ...
確定! 回上一頁