From 17ba60e587d554ca7e01afda32afdffc5803d7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Wed, 18 May 2022 18:24:13 +0200 Subject: [PATCH] Mark copy constructor and assignment of ModelTree as protected This limits the risk of slicing. The same is not possible for DataTree, since that base class is directly used in some places. --- src/ModelTree.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ModelTree.hh b/src/ModelTree.hh index c2684f26..291a839d 100644 --- a/src/ModelTree.hh +++ b/src/ModelTree.hh @@ -409,9 +409,11 @@ public: ExternalFunctionsTable &external_functions_table_arg, bool is_dynamic_arg = false); +protected: ModelTree(const ModelTree &m); ModelTree &operator=(const ModelTree &m); +public: //! Absolute value under which a number is considered to be zero double cutoff{1e-15}; //! Compute the minimum feedback set -- GitLab