STL中Vector容器Find的使用(泛型)
来源:互联网 发布:淘宝上那些解id可信吗 编辑:程序博客网 时间:2024/05/13 03:33
#include <list>#include <algorithm>#include <iostream>using namespace std;class CTest{public:CTest(int x, int y) { this->x = x; this->y = y; };~CTest() { };bool operator == (const CTest &other);public:int x;int y;};bool CTest::operator == (const CTest &other){if(this->x == other.x && this->y == other.y)return true;elsereturn false;}int main(){list < CTest > Test;list < CTest > :: iterator iter;Test.push_back(CTest(10, 20));Test.push_back(CTest(30, 40));Test.push_back(CTest(50, 60));iter = find(Test.begin(), Test.end(), CTest(30, 40));if(iter != Test.end())cout << iter->x << "\t" << iter->y << endl;elsecout << "Can't find it!" << endl; return 0;}
0 0
- STL中Vector容器Find的使用(泛型)
- STL中Vector容器Find的使用(int查找)
- STL中vector,find,insert的使用
- STL容器vector使用
- C++STL中vector容器的用法
- vector -- STL中容器的常用函数
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- C++STL中vector容器的用法
- vector容器类的使用[c++ stl]
- 使用STL的vector容器类
- STL中vector的使用
- STL《1》STL简介及vector容器的使用
- 介绍STL中vector容器
- Android异步从网络加载图片BitmapFactory.decodeStream 返回null的问题
- SEO最终是为了什么?
- hadoop生态系统
- 字节流与位流的相互转换实现
- iPhone开发-创建、读取、写入文件 今天的东西是如何在iPhoneOS下创建、删除、读取、写入文件 创建与删除: //创建文件管理器 NSFileManager *fileManager =
- STL中Vector容器Find的使用(泛型)
- 技巧:Linux 动态库与静态库制作及使用详解
- 【Java笔记】C++与Java的对比
- 杭电 1175 连连看
- 第一个小项目 - 去掉指定文件中的注释
- 杭电 1016 Prime Ring Problem
- 第二个小项目 - 拼图
- 第三个小项目 - 走迷宫
- 杭电 1257 最少拦截系统