From 8a0de34ad09bd31be9cc755520764d6e424deeba Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 27 Jul 2017 16:14:54 +0200 Subject: [PATCH] Evaluation: use the trivial copy constructor and copy operator this potentially allows the compiler to do better optimizations. --- bin/genEvalSpecializations.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/bin/genEvalSpecializations.py b/bin/genEvalSpecializations.py index 1e22bc916..71e801b05 100755 --- a/bin/genEvalSpecializations.py +++ b/bin/genEvalSpecializations.py @@ -124,17 +124,7 @@ public: {} //! copy other function evaluation - Evaluation(const Evaluation& other) -{% if numDerivs < 0 %}\ - : data_(other.data_) - { } -{% else %}\ - { -{% for i in range(0, numDerivs+1) %}\ - data_[{{i}}] = other.data_[{{i}}]; -{% endfor %}\ - } -{% endif %}\ + Evaluation(const Evaluation& other) = default; // create an evaluation which represents a constant function // @@ -469,20 +459,7 @@ public: } // copy assignment from evaluation - Evaluation& operator=(const Evaluation& other) - { -{% if numDerivs < 0 %}\ - for (int i = 0; i < length_; ++i) { - data_[i] = other.data_[i]; - } -{% else %}\ -{% for i in range(0, numDerivs+1) %}\ - data_[{{i}}] = other.data_[{{i}}]; -{% endfor %}\ -{% endif %}\ - - return *this; - } + Evaluation& operator=(const Evaluation& other) = default; template bool operator==(const RhsValueType& other) const