Action #1843
Avoid code duplication in const and non-const functions and operators
Status: | In Progress | Start date: | 08/12/2016 | ||
---|---|---|---|---|---|
Priority: | Normal | Due date: | |||
Assigned To: | - | % Done: | 10% | ||
Category: | - | ||||
Target version: | - | ||||
Duration: |
Description
Non-const and const functions and operators often contain the same code. This should be avoided. The problem is described and a solution is proposed here: http://stackoverflow.com/questions/123758/how-do-i-remove-code-duplication-between-similar-const-and-non-const-member-func
This solution should be implement for all non-const GammaLib functions and operators that have also a const version (in case that their code is identical, which should be the case).
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen almost 5 years ago
- Target version set to 1.7.0
#2 Updated by Knödlseder Jürgen almost 4 years ago
- Target version changed from 1.7.0 to 2.0.0
Moved issue to next release.
#3 Updated by Knödlseder Jürgen over 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
I implement some type casting for GXmlNode
:
GXmlElement* GXmlNode::element(const int& index)
{
// Return child element using const method
return const_cast<GXmlElement*>(static_cast<const GXmlNode*>(this)->element(index));
}
The
GXmlNode
will go into the bugfix release 1.7.1.#4 Updated by Knödlseder Jürgen about 2 years ago
- Target version deleted (
2.0.0)