I use Qt 5.2. In my program I want to change standard implementation of QString::toDouble(bool *ok) function. I write:
double QString::toDouble(bool *ok) const{
return QLocale().toDouble(this);
}
When I compile it with option -std=C++0x
it makes next error:
Multiple definition of `QString::toDouble(bool*) const'
I know, I can do it in languages like Ruby. I think this way is quite good to change toDouble locale. Please, correct me if it is a bad programming style or help to realize that.
Update But compiler allows me to change implementation of static function
QString QString::number(double n, char f, int prec){
return QLocale().toString(n, f, prec);
}
Is it a bad programming style too?