@@ -253,8 +253,11 @@ def init_code(cons):
253253 return init
254254
255255 constructors = [x for x in self .public_members if isinstance (x , Constructor )]
256+ # don't export copy constructors if the class is abstract
257+ # we could remove all constructors, but this will have the effect of
258+ # inserting no_init in the declaration, which would not allow
259+ # even subclasses to be instantiated.
256260 self .constructors = constructors [:]
257- # don't export constructors if the class is abstract
258261 if self .class_ .abstract :
259262 for cons in constructors :
260263 if cons .IsCopy ():
@@ -277,6 +280,7 @@ def init_code(cons):
277280 for cons in constructors :
278281 code = '.def(%s)' % init_code (cons )
279282 self .Add ('inside' , code )
283+
280284 # check if the class is copyable
281285 if not self .class_ .HasCopyConstructor () or self .class_ .abstract :
282286 self .Add ('template' , namespaces .boost + 'noncopyable' )
@@ -392,7 +396,7 @@ def IsExportable(m):
392396 # add wrapper code if this method has one
393397 wrapper = method_info .wrapper
394398 if wrapper and wrapper .code :
395- self .Add ('declaration-outside ' , wrapper .code )
399+ self .Add ('declaration' , wrapper .code )
396400
397401 # export staticmethod statements
398402 for name in staticmethods :
0 commit comments