group.cpp
来自「数据结构 ssd5 ex2」· C++ 代码 · 共 28 行
CPP
28 行
#include"Group.h"
//Adds the Client pointer given by the parameter to the vector objects
void Group::add(Client* ptr)
{
this->objects.push_back(ptr);
}
//This returns an iterator to the first Client* in vector objects
Group::iterator Group::begin()
{
return this->objects.begin();
}
//This returns an iterator to the last Client* in vector objects
Group::iterator Group::end()
{
return this->objects.end();
}
//This returns the Client pointer whose object's email equals the parameter email
Client *Group::operator[](const string& email)
{
for(int i=0;i<objects.capacity();++i)
{
if(objects.at(i)->getEmail() == email)
{
return objects.at(i);
}
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?