1 package Moose::Meta::Method::Accessor::Native::Array::pop;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
12 with 'Moose::Meta::Method::Accessor::Native::Array::Writer' => {
14 qw( _maximum_arguments
15 _inline_capture_return_value
16 _inline_optimized_set_new_value
21 sub _maximum_arguments { 0 }
23 sub _adds_members { 0 }
25 sub _potential_value {
26 my ( $self, $slot_access ) = @_;
28 return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 0 .. \$#{ ($slot_access) } - 1 ] : () ]";
31 sub _inline_capture_return_value {
32 my ( $self, $slot_access ) = @_;
34 return "my \$old = ${slot_access}->[-1];";
37 sub _inline_optimized_set_new_value {
38 my ( $self, $inv, $new, $slot_access ) = @_;
40 return "pop \@{ ($slot_access) }";
44 my ( $self, $slot_access ) = @_;
46 return 'return $old;';