Fix SimpleGuesser::operator=' should return 'SimpleGuesser &

Change-Id: I29205bc8db7569cf123a52dd248a9165ebaef3a3
This commit is contained in:
Julien Nabet
2012-12-29 13:37:25 +01:00
parent 6306926e03
commit cf068828d3
2 changed files with 9 additions and 4 deletions
@@ -95,9 +95,14 @@ SimpleGuesser::SimpleGuesser()
h = NULL;
}
void SimpleGuesser::operator=(SimpleGuesser& sg){
SimpleGuesser& SimpleGuesser::operator=(const SimpleGuesser& sg){
// Check for self-assignment!
if (this == &sg) // Same object?
return *this; // Yes, so skip assignment, and just return *this.
if(h){textcat_Done(h);}
h = sg.h;
return *this;
}
SimpleGuesser::~SimpleGuesser()
@@ -37,10 +37,10 @@ public:
/**inits the object with conf file "./conf.txt"*/
SimpleGuesser();
/** Compares the current Simpleguesser with an other
* @param SimpleGuesser& sg the other guesser to compare
/**
* @param SimpleGuesser& sg the other guesser
*/
void operator=(SimpleGuesser& sg);
SimpleGuesser& operator=(const SimpleGuesser& sg);
/**
* destroy the object