use Class::Load qw(load_class);
use Scalar::Util 'blessed';
-use Carp 'confess';
use Devel::GlobalDestruction 'in_global_destruction';
use Moose::Meta::Class;
my %options = @args;
(ref $options{attributes} eq 'HASH')
- || confess "You must pass a HASH ref of attributes"
+ || Moose::Util::throw "You must pass a HASH ref of attributes"
if exists $options{attributes};
(ref $options{methods} eq 'HASH')
- || confess "You must pass a HASH ref of methods"
+ || Moose::Util::throw "You must pass a HASH ref of methods"
if exists $options{methods};
(ref $options{roles} eq 'ARRAY')
- || confess "You must pass an ARRAY ref of roles"
+ || Moose::Util::throw "You must pass an ARRAY ref of roles"
if exists $options{roles};
my $package = delete $options{package};
=back
+=head2 Overload introspection and creation
+
+The methods for dealing with a role's overloads are all identical in API
+and behavior to the same methods in L<Class::MOP::Class>. Note that these are
+not particularly useful (yet), because overloads do not participate in role
+composition.
+
+=over 4
+
+=item B<< $metarole->is_overloaded >>
+
+=item B<< $metarole->get_overloaded_operator($op) >>
+
+=item B<< $metarole->has_overloaded_operator($op) >>
+
+=item B<< $metarole->get_overload_list >>
+
+=item B<< $metarole->get_all_overloaded_operators >>
+
+=item B<< $metarole->add_overloaded_operator($op, $impl) >>
+
+=item B<< $metarole->remove_overloaded_operator($op) >>
+
+=back
+
=head2 Required methods
=over 4