<分区>
我有一个 S 类:
class S
{
public:
S(int ssx, int ssy, int cnt)
{
sx = ssx;
sy = ssy;
count = cnt;
}
int sx;
int sy;
int count;
};
我想制作一个容器,它可以找到与 2 个参数匹配的元素的指针(迭代器)(比如对 {sx, sy},这对应该等于容器中的元素对)。 是否有任何 STL 方法,或者我应该使用圆圈 FOR(;;) 和 S* 的简单 vector 来实现搜索?