Programming
donkey301
CAE/CAD领域软件开发,专注算法研究、数值计算
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
匿名命名空间或者static的使用
Q:普通的两个c++函数,fun1(), fun2() 我希望fun1()只能被fun2()调用,其它函数都没法调用,请问怎么做? 一种方式是取消fun1(),直接在fun2()中实现fun1()。 不过我还是想知道还有没有其它实现方式?A:1. fun1设置为static2. 用匿名命名空间http://hi.baidu.com/%CF%F4%CA%AE%C8%FD%C0%C9/blog/item/97f1af3806d66ccad462250a.html原创 2010-09-13 15:04:00 · 698 阅读 · 0 评论 -
模板中用iterator
<br /> template <class _T><br /> void AdvanceOneIterator(typename std::list<_T*>::iterator it, const list<_T*>& L)原创 2010-09-09 09:29:00 · 534 阅读 · 0 评论 -
const指针和指向const对象的指针
<br />对这两个概念老是混淆,最近又遇到一个类似题目:<br />//Code A typedef map<int, int> MapInt; MapInt aMapInt; const int A = 1; A = 3; aMapInt.find(A); //Code B typedef map<int*, int> MapPoint; MapPoint aMapPoint; const int* B = new int; aMapPoint.find(B);原创 2010-09-26 09:34:00 · 687 阅读 · 0 评论
分享