@@ -53,8 +53,11 @@ struct dynamic_attr { };
5353// / Annotation which enables the buffer protocol for a type
5454struct buffer_protocol { };
5555
56- // / Annotation which requests that a special metaclass is created for a type
57- struct metaclass { };
56+ // / DEPRECATED: Annotation which requests that a special metaclass is created for a type
57+ struct metaclass {
58+ PYBIND11_DEPRECATED (" py::metaclass() is no longer required. It's turned on by default now." )
59+ metaclass () = default ;
60+ };
5861
5962// / Annotation to mark enums as an arithmetic type
6063struct arithmetic { };
@@ -149,8 +152,7 @@ struct function_record {
149152// / Special data structure which (temporarily) holds metadata about a bound class
150153struct type_record {
151154 PYBIND11_NOINLINE type_record ()
152- : multiple_inheritance(false ), dynamic_attr(false ),
153- buffer_protocol(false ), metaclass(false ) { }
155+ : multiple_inheritance(false ), dynamic_attr(false ), buffer_protocol(false ) { }
154156
155157 // / Handle to the parent scope
156158 handle scope;
@@ -188,9 +190,6 @@ struct type_record {
188190 // / Does the class implement the buffer protocol?
189191 bool buffer_protocol : 1 ;
190192
191- // / Does the class require its own metaclass?
192- bool metaclass : 1 ;
193-
194193 // / Is the default (unique_ptr) holder type used?
195194 bool default_holder : 1 ;
196195
@@ -354,11 +353,8 @@ struct process_attribute<buffer_protocol> : process_attribute_default<buffer_pro
354353 static void init (const buffer_protocol &, type_record *r) { r->buffer_protocol = true ; }
355354};
356355
357- template <>
358- struct process_attribute <metaclass> : process_attribute_default<metaclass> {
359- static void init (const metaclass &, type_record *r) { r->metaclass = true ; }
360- };
361-
356+ // DEPRECATED
357+ template <> struct process_attribute <metaclass> : process_attribute_default<metaclass> { };
362358
363359// / Process an 'arithmetic' attribute for enums (does nothing here)
364360template <>
0 commit comments