Fix missing copy constructor that was not being generated into the python script. Add utility method to easily add a copy constructor to a class.
This commit is contained in:
1 parent
20d58453b1
commit
311f18b98d
4 files changed
+41
-3
No files matched your search
@@ -1185,6 +1185,19 @@ public:
|
||||
self._add_constructor_obj(constructor)
|
||||
return constructor
|
||||
|
||||
def add_copy_constructor(self):
|
||||
"""
|
||||
Utility method to add a 'copy constructor' method to this class.
|
||||
"""
|
||||
try:
|
||||
constructor = CppConstructor([self.ThisClassRefParameter("%s &" % self.full_name,
|
||||
'ctor_arg', is_const=True)])
|
||||
except utils.SkipWrapper:
|
||||
return None
|
||||
constructor.stack_where_defined = traceback.extract_stack()
|
||||
self._add_constructor_obj(constructor)
|
||||
return constructor
|
||||
|
||||
def add_function_as_constructor(self, *args, **kwargs):
|
||||
"""
|
||||
Wrap a function that behaves as a constructor to the class. See the documentation for
|
||||
|
||||
Reference in new issue
Block a user