Skip to content

Commit

Permalink
Make clone return a mutable object (#224)
Browse files Browse the repository at this point in the history
* Make clone return a mutable object

* Make docstring more clear
  • Loading branch information
tmadlener authored Oct 8, 2021
1 parent 2256be0 commit 1d680fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/templates/macros/declarations.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
/// copy-assignment operator
{{ full_type }}& operator=({{ full_type }} other);

/// support cloning (deep-copy)
{{ full_type }} clone() const;
/// create a mutable deep-copy of the object with identical relations
{{ type }} clone() const;

/// destructor
~{{ full_type }}();
Expand Down
2 changes: 1 addition & 1 deletion python/templates/macros/implementations.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if (m_obj) m_obj->acquire();
}

{{ full_type }} {{ full_type }}::clone() const {
{{ type }} {{ full_type }}::clone() const {
return {new {{ type }}Obj(*m_obj)};
}

Expand Down

0 comments on commit 1d680fc

Please sign in to comment.