From: <rom...@us...> - 2008-06-26 10:49:06
|
Revision: 1358 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1358&view=rev Author: roman_yakovenko Date: 2008-06-26 03:49:15 -0700 (Thu, 26 Jun 2008) Log Message: ----------- updating to latest GCCXML version struct X{ const int items[10]; } will generate no_init in class_<...> constructor Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/class_declaration.py Modified: pyplusplus_dev/pyplusplus/code_creators/class_declaration.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 09:36:26 UTC (rev 1357) +++ pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 10:49:15 UTC (rev 1358) @@ -220,9 +220,17 @@ inits = filter( lambda x: isinstance( x, calldef.constructor_t ), self.creators ) has_nonpublic_destructor = declarations.has_destructor( self.declaration ) \ and not declarations.has_public_destructor( self.declaration ) + + #select all public constructors and exclude copy constructor + cs = self.declaration.constructors( lambda c: not c.is_copy_constructor and c.access_type == 'public' + , recursive=False, allow_empty=True ) + has_suitable_constructor = bool( cs ) + if cs and len(cs) == 1 and cs[0].is_trivial_constructor and self.declaration.find_noncopyable_vars(): + has_suitable_constructor = False + if has_nonpublic_destructor \ or ( self.declaration.is_abstract and not self.wrapper ) \ - or not declarations.has_any_non_copyconstructor(self.declaration): + or not has_suitable_constructor: result.append( ", " ) result.append( algorithm.create_identifier( self, '::boost::python::no_init' ) ) elif not self.declaration.find_trivial_constructor(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |