Removed this ugly defaulting to 1 behaviour and solved it using template specialization

This commit is contained in:
mac 2000-05-25 13:04:57 +00:00
commit 6893a8565d
2 changed files with 15 additions and 3 deletions

View file

@ -169,6 +169,21 @@ private :
ValueType repValue;
};
/// Specialized setValue for bool
template <>
void eoValueParam<bool>::setValue(std::string _value)
{
if (_value.empty())
{
repValue = true;
return;
}
std::istrstream is(_value.c_str());
is >> repValue;
}
/// Because MSVC does not support partial specialization, the pair is a double, not a T
template <>
std::string eoValueParam<std::pair<double, double> >::getValue(void) const