Use operator overloading best practices.

Not all files covered.

Refer to StackOverflow for details: http://stackoverflow.com/a/4421719
This commit is contained in:
Jason Felds
2014-11-26 14:51:21 -05:00
parent 1a51b06934
commit 3451b2f2d5
10 changed files with 218 additions and 97 deletions
+10 -1
View File
@@ -27,8 +27,17 @@ struct StepsTypeAndDifficulty
Difficulty cd;
StepsTypeAndDifficulty( const StepsType &s, const Difficulty &d ) : st( s ), cd( d ) { }
bool operator==( const StepsTypeAndDifficulty &stad ) const { return st == stad.st && cd == stad.cd; }
};
inline bool operator==(StepsTypeAndDifficulty const &lhs, StepsTypeAndDifficulty const &rhs)
{
return lhs.st == rhs.st && lhs.cd == rhs.cd;
}
inline bool operator!=(StepsTypeAndDifficulty const &lhs, StepsTypeAndDifficulty const &rhs)
{
return !operator==(lhs,rhs);
}
static void SetNextCombination()
{
vector<StepsTypeAndDifficulty> v;