Simply put, generics provide compile-time type safety for collections.
简单来说,泛型为集合提供了编译时类型安全。
Of course, you also give up the safety net of the compile-time type checking.
当然,还会失去编译时检查的安全保障。
For the trouble, you get rock-solid performance, compile-time type checking, and a very high-level language.
虽然付出了这一点成本,但可以得到非常好的性能,编译时类型检查,以及一个非常高级的语言。
You can then treat each named value as an instance of that class, providing you with compile-time type safety that a named set of integers can't.
然后,可以将每个指定的值看作是那个类的一个实例,这为您提供了指定的整数集合所无法提供的编译时类型安全。
Generics are useful because they provide stronger compile-time type checking, require fewer explicit conversions between data types, and reduce the need for boxing operations and run-time type checks.
泛型相当有用,因为他们提供强制的编译时类型检查,要求更少的数据类型之间的显式转换,并减少装箱拆箱的操作和运行时类型检查。
These operators return dynamic type information only for classes with one or more virtual functions. For all other types, information for the static (i. e. , compile-time) type is returned.
这些操作符只为带有一个或多个虚函数的类返回动态类型信息,对于其他类型,返回静态(即编译时)类型的信息。
These operators return dynamic type information only for classes with one or more virtual functions. For all other types, information for the static (i. e. , compile-time) type is returned.
这些操作符只为带有一个或多个虚函数的类返回动态类型信息,对于其他类型,返回静态(即编译时)类型的信息。
应用推荐