Default: Updates to ParserItem::equal()

1. The boolean flag m_defaultSet() is included in the actual
    comparison.

 2. The compare functions is implemented as a functions template.
This commit is contained in:
Joakim Hove
2014-08-21 14:02:13 +02:00
parent de73c688e3
commit 8b2981283f
6 changed files with 30 additions and 33 deletions

View File

@@ -79,16 +79,9 @@ namespace Opm
bool ParserFloatItem::equal(const ParserItem& other) const
{
// cast to a pointer to avoid bad_cast exception
const ParserFloatItem* rhs = dynamic_cast<const ParserFloatItem*>(&other);
if (rhs && ParserItem::equal(other) && (getDefault() == rhs->getDefault())) {
return equalDimensions( other );
}
else
return false;
return (ParserItemEqual<ParserFloatItem>(this , other) && equalDimensions(other));
}
bool ParserFloatItem::equalDimensions(const ParserItem& other) const {
bool equal_=false;
if (other.numDimensions() == numDimensions()) {