Skip to content

Commit

Permalink
Make the clone function return mutable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Oct 11, 2021
1 parent 862e143 commit e4efbcb
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);

/// create a mutable deep-copy of the object with identical relations
{{ type }} clone() const;
/// create a mutable deep-copy of the object with identical relations
Mutable{{ 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();
}

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

Expand Down

0 comments on commit e4efbcb

Please sign in to comment.