Skip to content

Commit

Permalink
Add another pass by const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Apr 16, 2024
1 parent 53ded81 commit 83b55e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/templates/macros/declarations.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
{% macro multi_relation_handling(relations, get_syntax, with_adder=False) %}
{% for relation in relations %}
{% if with_adder %}
void {{ relation.setter_name(get_syntax, is_relation=True) }}({{ relation.full_type }});
void {{ relation.setter_name(get_syntax, is_relation=True) }}(const {{ relation.full_type }}&);
{% endif %}
std::size_t {{ relation.name }}_size() const;
{{ relation.full_type }} {{ relation.getter_name(get_syntax) }}(std::size_t) const;
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 @@ -98,7 +98,7 @@ void {{ class_type }}::{{ relation.setter_name(get_syntax) }}({{ relation.full_t
{% set class_type = prefix + class.bare_type %}
{% for relation in relations %}
{% if with_adder %}
void {{ class_type }}::{{ relation.setter_name(get_syntax, is_relation=True) }}({{ relation.full_type }} component) {
void {{ class_type }}::{{ relation.setter_name(get_syntax, is_relation=True) }}(const {{ relation.full_type }}& component) {
m_obj->m_{{ relation.name }}->push_back(component);
m_obj->data.{{ relation.name }}_end++;
}
Expand Down

0 comments on commit 83b55e9

Please sign in to comment.