Bug in GetValueAndParam() function?
In TtMathObjects.h the following function is implemented:
this method gets the value and the number of parameters
of a specific object
ErrorCode GetValueAndParam(const std::string & name, std::string & value, int * param) const
if( !IsNameCorrect(name) )
CIterator i = table.find(name);
if( i == table.end() )
*param = 0;
value = i->second.value;
*param = i->second.param;
Is it safe to say the line with the function value.empty(); is incorrect?
Testing whether value is empty makes no sense. Did you mean to clear the value? In that case, you should change it to value.clear();
If I'm right, could you please update your source code for the next release?
I got pointed to it by cppcheck conde-analysis.
The "const char**" overload also cleans out the value pointer. I conclude this must be a mistake.
yes, value.empty() is strange here, I have to check this.