开发者

Declare generic class (like Vector) in Actionscript3

开发者 https://www.devze.com 2023-03-12 14:35 出处:网络
As you all know, Vector support type checking by added Type parameter. var v:Vector.<String> = new Vector.<String>();

As you all know, Vector support type checking by added Type parameter.

var v:Vector.<String> = new Vector.<String>();

I wonder if I am able to cr开发者_StackOverflow中文版eate a custom class that have Type parameter, something like this

var myClassInstance: MyClassDefinition.<String>;

Thank you.

Harry.


ActionScript doesn’t (yet) support generics. Vector is a special case with support hard-coded into the compiler.

See also: Why doesn't ActionScript have “generics”?

0

精彩评论

暂无评论...
验证码 换一张
取 消