1 package Moose::Meta::Method::Accessor::Native::Array::insert;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
12 with 'Moose::Meta::Method::Accessor::Native::Array::Writer' => {
18 _inline_optimized_set_new_value
24 sub _minimum_arguments { 2 }
26 sub _maximum_arguments { 2 }
28 sub _adds_members { 1 }
30 sub _potential_value {
31 my ( $self, $slot_access ) = @_;
34 "( do { my \@potential = \@{ $slot_access }; splice \@potential, \$_[0], 0, \$_[1]; \\\@potential } )";
37 sub _new_members { '$_[1]' }
39 sub _inline_optimized_set_new_value {
40 my ( $self, $inv, $new, $slot_access ) = @_;
42 return "splice \@{ $slot_access }, \$_[0], 0, \$_[1];";
46 my ( $self, $slot_access ) = @_;
48 return "return ${slot_access}->[ \$_[0] ];";