[pygccxml-commit] SF.net SVN: pygccxml: [955] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-03-11 11:12:25
|
Revision: 955 http://svn.sourceforge.net/pygccxml/?rev=955&view=rev Author: roman_yakovenko Date: 2007-03-11 04:10:10 -0700 (Sun, 11 Mar 2007) Log Message: ----------- correcting small bug in generating wrapper copy constructors Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_creator/creator.py pyplusplus_dev/unittests/data/operators_bug_to_be_exported.hpp pyplusplus_dev/unittests/operators_bug_tester.py Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/creator.py 2007-03-08 07:33:42 UTC (rev 954) +++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2007-03-11 11:10:10 UTC (rev 955) @@ -622,9 +622,10 @@ else: self.__extmodule.adopt_declaration_creator( wrapper ) if declarations.has_trivial_copy( self.curr_decl ): - #I don't know but sometimes boost.python requieres - #to construct wrapper from wrapped classe - if not self.curr_decl.noncopyable: + #~ #I don't know but sometimes boost.python requieres + #~ #to construct wrapper from wrapped classe + copy_constr = self.curr_decl.constructor( lambda c: c.is_copy_constructor, recursive=False ) + if not self.curr_decl.noncopyable and copy_constr.is_artificial: copy_constr = code_creators.copy_constructor_wrapper_t( class_inst=self.curr_decl ) wrapper.adopt_creator( copy_constr ) null_constr = declarations.find_trivial_constructor(self.curr_decl) Modified: pyplusplus_dev/unittests/data/operators_bug_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/operators_bug_to_be_exported.hpp 2007-03-08 07:33:42 UTC (rev 954) +++ pyplusplus_dev/unittests/data/operators_bug_to_be_exported.hpp 2007-03-11 11:10:10 UTC (rev 955) @@ -6,6 +6,8 @@ #ifndef __operators_bug_to_be_exported_hpp__ #define __operators_bug_to_be_exported_hpp__ +#include <string> + namespace operators_bug{ template< typename derived_type, typename value_type > @@ -46,7 +48,19 @@ }; +struct call_copy_constructor_t{ + explicit call_copy_constructor_t( const std::string& x ) + {} + + call_copy_constructor_t( const call_copy_constructor_t& x ){}; + + call_copy_constructor_t& operator=( const call_copy_constructor_t& x ){ + return *this; + } + + virtual void do_nothing(){} +}; } -#endif//__operators_bug_to_be_exported_hpp__ \ No newline at end of file +#endif//__operators_bug_to_be_exported_hpp__ Modified: pyplusplus_dev/unittests/operators_bug_tester.py =================================================================== --- pyplusplus_dev/unittests/operators_bug_tester.py 2007-03-08 07:33:42 UTC (rev 954) +++ pyplusplus_dev/unittests/operators_bug_tester.py 2007-03-11 11:10:10 UTC (rev 955) @@ -24,6 +24,7 @@ tg = code_creators.target_configuration_t( ) #tg.boost_python_has_wrapper_held_type = False mb.build_code_creator( self.EXTENSION_NAME, target_configuration=tg ) + mb.constructors().allow_implicit_conversion = False def run_tests(self, module): i = module.integral() @@ -31,6 +32,9 @@ j = i + i v = module.vector( 2 ) + module.vector.one self.failUnless( v.x == 3 ) + + call_copy_constructor = module.call_copy_constructor_t( "" ) + call_copy_constructor2 = module.call_copy_constructor_t( call_copy_constructor ) def create_suite(): suite = unittest.TestSuite() @@ -41,4 +45,4 @@ unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": - run_suite() \ No newline at end of file + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |