group.cpp
来自「本程序给出了SSD5实验课中Exercise6的参考程序 内附有详细的注释 下载」· C++ 代码 · 共 31 行
CPP
31 行
#pragma warning (disable:4786)
#pragma warning (disable:4503)
#include "Group.h"
//Adds the Client pointer given by the parameter to the vector objects.
void Group::add(Client* ptr) {
objects.insert(pair<string, Client*>(ptr->getEmail(), ptr));
}
//This returns an iterator to the first Client* in vector objects.
Group::iterator Group::begin() {
return objects.begin();
}
//This returns an iterator to the last Client* in vector objects.
Group::iterator Group::end() {
return objects.end();
}
//This returns the Client pointer whose object's email equals the parameter email.
Client* Group::operator[](const string& email) {
if( objects.find(email) == objects.end() )
return NULL;
return objects[email];
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?