1. 首页
  2. 数据库
  3. 其它
  4. p5 Type Utils Generics:轻松创建泛型类型 源码

p5 Type Utils Generics:轻松创建泛型类型 源码

上传者: 2021-04-22 07:55:55上传 ZIP文件 27.82KB 热度 7次
姓名 Type :: Utils :: Generics-轻松创建泛型类型 概要 use Type::Utils::Generics qw( class_generics T ); package Queue { use Moo; use Types::Standard -types; has data => ( is => 'ro', isa => ArrayRef, required => 1, ); } class_generics QueueType => ( class_name => 'Queue', attributes => +{ data => ArrayRef[ T(0) ] }, ); subtest 'Queue[Str]' => sub { my $QueueStrType = QueueT
下载地址
用户评论