- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 STL_Algorithm5-math: random_shuffle, count, count_if, min_element, max_element, accumulate, for_each, transform
STL_Algorithm5-math: random_shuffle, count, count_if, min_element, max_element, accumulate, for_each, transformminrandom_shuffle: 对v.begin()到v.end()之间的元素进行随机排序。count: 统计v.begin()到v.end()之间值为value的元素个数。count_if: 统计v.begin()到v.end()之间,满足判定条件的元素个数。m
2010-12-25 12:09:00 430
原创 STL_Algorithm4: Replace, replace_if, replace copy, replace_copy_if
STL_Algorithm4: Replace, replace_if, replace copy, replace_copy_if
2010-12-25 11:41:00 563
原创 STL_Algorithm3: remove, remove_if, remove_copy, remove_copy_if
STL Algorithm3: remove, remove_if, remove_copy, remove_copy_if 的用法示例
2010-12-23 23:37:00 366
原创 STL_Algorithm2: equal, mismatch, lexicographical_compare
STL Algorithm2: equal, mismatch, lexicographical_compare 的示例用法
2010-12-23 23:33:00 327
原创 STL_Algorithm1: Fill, Fill_n, Generate, Generate_n
STL, Algorithm: fill, fill_n, generate, generate_n的例子程序
2010-12-23 23:25:00 343
原创 C++中的几种type cast
static_cast:无条件转换,强制隐式转换,implicit conversion, 例如:non const -> const, int -> doubledynamic_cast:有条件转换,进行执行期检验;安全向下转型(safe down casting)决定某对象是否属于继承体系中的某个类型。reinterpret_cst:低级转型,例如:pointer to int (int*) -> intconst_cast:将对象的常量性去掉(cast away the constness);
2010-12-12 12:18:00 847
原创 STL容器使用中的拷贝成本
STL, 序列化容器的在使用时隐藏的拷贝成本, vector是连续存储的,可理解成可变空间大小的数组,但灵活就要有成本.你会发现在前面insert一个对象的成本有多大,STL vector的实现有点让人匪夷所思。
2010-12-11 23:36:00 358
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人