[pygccxml-commit] SF.net SVN: pygccxml:[1782] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2009-12-23 21:26:05
|
Revision: 1782
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1782&view=rev
Author: roman_yakovenko
Date: 2009-12-23 21:25:58 +0000 (Wed, 23 Dec 2009)
Log Message:
-----------
according to MSDN(http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx) conversion constructor is a constructor that could be called with one argument - this change implements this behaviour
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
pyplusplus_dev/unittests/casting_tester.py
pyplusplus_dev/unittests/data/casting_to_be_exported.hpp
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-23 21:25:58 UTC (rev 1782)
@@ -341,14 +341,14 @@
For more information see:
* http://boost.org/libs/python/doc/v2/implicit.html#implicitly_convertible-spec
-
* http://msdn2.microsoft.com/en-us/library/h1y7x448.aspx
+ * http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx
"""
if self.parent.is_abstract: #user is not able to create an instance of the class
return False
if self.is_copy_constructor:
return False
- if 1 != len( self.arguments ):
+ if 1 != len( self.required_args ):
return False
if self.parent.find_out_member_access_type( self ) != declarations.ACCESS_TYPES.PUBLIC:
return False
Modified: pyplusplus_dev/unittests/casting_tester.py
===================================================================
--- pyplusplus_dev/unittests/casting_tester.py 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/unittests/casting_tester.py 2009-12-23 21:25:58 UTC (rev 1782)
@@ -28,6 +28,9 @@
self.failUnless( 0 == module.x_value(False) )
fv = module.float_vector( 5.0 )
+ cc = module.get_value_a( 78 );
+ self.failUnless( cc == -78 )
+
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
Modified: pyplusplus_dev/unittests/data/casting_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-23 21:25:58 UTC (rev 1782)
@@ -8,6 +8,20 @@
namespace casting{
+struct conversion_constructor_t{
+ conversion_constructor_t( int a, int b=0 )
+ : value_a( a* (-1) ), value_b( b * (-1) )
+ {}
+ int value_a;
+ bool value_b;
+};
+
+int get_value_a( int a ){
+ conversion_constructor_t cc( a );
+ return cc.value_a;
+}
+
+
struct y{};
struct x{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|