示例#1
0
文件: Name.cpp 项目: dweitz/Blue-Jay
bool operator==(const Name& first, const Name& second)
{
	//printf("first=%s, second=%s", first.getName().c_str(), second.getName().c_str());
	if (first.getName() == second.getName())
	{
		//printf(" both are the same \r\n");
		return true;
	}
	else
	{
		//printf(" they are different \r\n");
		return false;
	}
}
示例#2
0
int main(){
  Name na;
  na.setName("Dhruv");
  cout<<na.getName()<<endl;
  return 0;
}
示例#3
0
文件: Name.cpp 项目: dweitz/Blue-Jay
bool operator<(const Name& first, const Name& second)
{
	return (first.getName() < second.getName());
}
示例#4
0
// Define a "less than" operator for comparison: used for hashing
bool operator<(Name a, Name b)
{
    return strcmp(a.getName(), b.getName())< 0;
}