ChinaUnix.net
相关文章推荐:

C 容器举例

Extension Manager基本概念:什么是 Extension Manager Extension Manager 是 Lotus c API 提供的一个功能非常强大的设计机制,它允许应用程序设计者向 Notes/Domino 系统注册自己感兴趣的事件,例如:EM_NSFDBcLOSESESSION、EM_NSFDBcLOSE 等。从而在 Notes/Domino 进行内核操作之前(或者之后,取决于在事件注册中使用的是 EM_REG_BEFORE 还是 EM_REG_AFTER)来运行自己设计的特制插件程序。 Extension Manager程序设计规...

by 杨竹青 - OpenAPI - 2008-07-24 08:51:57 阅读(2133) 回复(0)

相关讨论

容器到底是啥,是封装的一段代码吗?

by hhdzhu - C/C++ - 2014-06-25 15:12:43 阅读(4417) 回复(8)

本帖最后由 yshihyu 于 2013-09-13 00:06 编辑 请问一下 container 用 for 取出 容器内容 , size() 需要加上锁吗? 因为最近看一下代码发现只有对容器做 add , remove 才加上锁, 感觉应该要加上锁才正确? 如果像下面 get() 跟 size() 动作需要加上锁吗? for (int i = 0; i < container->size(); i++ ) { container->get(i); // 取出容器内容 } 谢谢

by yshihyu - C/C++ - 2013-09-13 09:44:30 阅读(3067) 回复(4)

本帖最后由 titer1 于 2012-08-09 15:17 编辑 看到前面有个帖子在 问:是否知道stl里所有容器的各种操作效率和占用空间大小? 不懂,在google找到个表格,与大家共勉。 Member mapThis is a comparison chart with the different member functions present on each of the different containers: [td=3,1][td=3,1]Sequence containers[td=4,1]Associative containers [td=3,1]Headersctor>[td=2,1][td=...

by titer1 - C/C++ - 2012-08-09 15:19:08 阅读(1951) 回复(1)

iterator begin() { return iterator(_Base::begin(), this); } const_iterator begin() const { return const_iterator(_Base::begin(), this); } 这种不算方法重名吗 为什么可以这样

by yunyue520 - C/C++ - 2010-08-28 13:06:48 阅读(1396) 回复(6)

近来在学习c++ primer(第四版),看到第276页,对书上例举的一段代码不解,贴出来请教各位大虾 vector::iterator first = v.begin(); while (first != v.end()) { //do some processing first = v.insert(first, 42); //insert new value ++first; //advance first just past the element we added } 我认为这段代码将会陷入死循环,直至内存耗光,不知是不是理解正确?

by longzhui - C/C++ - 2009-08-01 10:49:25 阅读(2859) 回复(13)

深入研究c++中的STL Deque容器 文件: 深入研究c++中的STL Deque容器.zip 大小: 124KB 下载: 下载 本文来自chinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/64804/showart_1716955.html

by Aquester - Linux文档专区 - 2008-12-13 00:50:01 阅读(851) 回复(0)

[code] #include #include using namespace std; class A { private: int data; public: A (int d ) {data = d;} int getdata () { return data; } friend bool operator< (const A &p1, const A &p2); ~A () {} }; bool operator< (const A &p1, const A &p2){ return p1.data < p2.data; } int main () { set coll; co...

by zwylinux - C/C++ - 2007-05-04 21:49:41 阅读(1845) 回复(9)

欢迎大家比较各自的测试结果 [code] /* Standard container Benchmark Version 0.9, May 23, 2003 The primary purpose of this benchmark is to show how different standard containers are in terms of performance. We have observed that programmers often use sets, multisets, deques in the situations where sorted vectors are the optimal solutions. Similarly, programmers often choose lists simply be...

by doctorjxd - C/C++ - 2012-08-23 16:00:57 阅读(4702) 回复(21)
by luckysir - C/C++ - 2012-01-17 08:31:35 阅读(1697) 回复(1)