自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(30)
  • 资源 (1)
  • 收藏
  • 关注

翻译 C# 析构函数解析(译)

C# 析构函数解析(译) Chandra Hundigam2002-06-18原文地址:http://www.c-sharpcorner.com/UploadFile/chandrahundigam/UnderstandingDestructors11192005021208AM/UnderstandingDestructors.aspx 这篇文章谈了如何理解C#的析构

2012-04-24 23:07:49 2401 1

翻译 Google C++ 编程风格指南(中文翻译)-2

类,未完,待续。

2011-03-21 21:36:00 3292

翻译 Google C++ 编程风格指南(中文翻译)-1

个人感觉总结的很好,正在试图翻译,待续...原文:http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

2011-03-16 00:02:00 1328

转载 RTTI

RTTI(Run-Time Type Identification,通过运行时类型识别)程序能够使用基类的指针或引用来检查这些指针或引用所指的对象的实际派生类型。

2011-03-14 21:43:00 373

原创 STL_Algorithm: heap

只能用于数组,vector, dequestd::make_heap( v.begin(), v.end() ); //建堆std::sort_heap( v.begin(), v.end() ); //对堆进行排序std::push_heap( v.begin(), v.end() ); //在堆中加一新值std::pop_heap( v.begin(), v.end() - index ); //删除堆顶元素, 进行元素位置改变,pop出的值放入v.end() - index处,这样

2011-01-09 22:32:00 511

原创 STL_Algorithm: lower_bound, upper_bound, equal_range

std::lower_bound( v.begin(), v.end(), value ); // 第一个value的位置std::upper_bound( v.begin(), v.end(), value ); //最后一个vlaue的位置std::pair iterator, std::vector iterator > eq_range = std::equal_range( v.begin(), v.end(), value ); //value的第一个和最后位置

2011-01-09 21:29:00 953

原创 STL_Algorithm10: Set--集合操作

std::includes( a1, a1 + SIZE1, a2, a2 + SIZE2 ); //包含关系,a1是否包含a2.std::set_difference( a1, a1 + SIZE1, a2, a2 + SIZE2, a3 ); //a1中不在a2中的元素std::set_intersection( a1, a1 + SIZE1, a2, a2 + SIZE2,a3 ); //交集std::set_sysmmetric_difference( a1, a1 + SIZE, a2

2011-01-06 22:31:00 710

原创 STL_Algorithm9: inplace_merge, unique_copy, reverse_copy

std::inplace_merge( c1.begin(), c1.begin() + mid, c1.end() ); //把c1内部的两个有序段mergestd::unique_copy( c1.begin(), c1.end(), std::back_inserter( c2 ) ); //把c1的所有唯一元素copy到c2std::reverse_copy( c1.begin(), c1.end(), std::back_inserter( c2 ) ); //把c1的元素颠倒copy到c

2011-01-05 23:07:00 531

原创 STL_Algorithm8: copy_backward, merge, unique, reverse

std::copy_backward( c1.begin(), c1.end(), c2.end() ); //从后往前copystd::merge( c1.begin(), c1.end(), c2.begin(), c2.end(), c3.begin() ); //把两个升序容器(c1, c2)合并为另一升序容器c3;std::merge( c1.begin(), c1.end(), c2.begin(), c2.end(), std::back_insert( c3 ) );std::u

2011-01-05 22:31:00 424

原创 STL_Algorithm7: swap

std::swap( a[0], a[1] ); //交换数组中的两个值std::iter_swap( &a[0], &a[1] );std::ranges( a, a+5, a+5 );//交换两个范围内的值,可用于交换不同数组

2011-01-03 22:50:00 536

原创 STL_Algorithm6--find, find_if, sort, binary_search

std::find( v.begin(), v.end(), value );std::find_if( v.begin(), v.end(), greater10 );std::sort( v.begin(), v.end() ); //要求随机访问迭代器std::binary_search( v.begin(), v.end(), value );//已经按升序排列

2011-01-03 22:20:00 570 2

原创 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 Container7: muiltiset

STL container multiset

2010-12-25 11:10:00 705

原创 STL Container6: Set

STL associate container: set

2010-12-25 11:08:00 367

原创 STL Container5: MultiMap

STL associate container: multimap

2010-12-25 11:00:00 372

原创 STL Container4: Map

STL Container: Associate container: Map

2010-12-25 10:58:00 308

原创 STL Container3: Deque

STL Container: Deque

2010-12-25 10:56:00 337

原创 STL Container2: List

STL Container List

2010-12-25 10:54:00 496

原创 STL Container1: Vector

STL Container, Vector

2010-12-25 10:52:00 303

原创 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 326

原创 STL_Algorithm1: Fill, Fill_n, Generate, Generate_n

STL, Algorithm: fill, fill_n, generate, generate_n的例子程序

2010-12-23 23:25:00 343

原创 file writer test

test the fwrite

2010-12-21 23:23:00 336

原创 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

原创 初始化列表

一,需要初始化的数据成员是对象的情况;二,需要初始化const修饰的类成员;三,需要初始化引用成员数据;

2010-06-22 23:25:00 597

原创 Pass by reference 为什么更安全?

引用的规则: (1)引用被创建的同时必须被初始化(指针则可以在任何时候被初始化)。 (2)不能有NULL引用,引用必须与合法的存储单元关联(指针则可以是NULL)。 (3)一旦引用被初始化,就不能改变引用的关系(指针则可以随时改变所指的对象)。

2010-06-22 23:12:00 336

原创 拷贝构造函数 与 拷贝赋值函数

拷贝构造函数 与 拷贝赋值函数 的异同

2010-06-22 23:09:00 442

转载 重写(覆盖)与重载 Override and Overload

 覆盖、重写与重载的理解 初次见到这两个单词并没有什么特别的感觉,但是时间长了,却发现书上一会儿用override,一会儿又用overload,搞得我的迷迷糊。于是就做了个总结,希望能对和我一样对这两个概念模糊不清的网友有一个帮助。    override可以翻译为覆盖,从字面就可以知道,它是覆盖了一个方法并且对其重写,以求达到不同的作用。对我们来说最熟悉的覆盖就是对接口方法的实现,在

2009-11-02 22:03:00 324

面向对象分析与设计英文版

面向对象分析与设计 ,英文版,经典的书籍,值得收藏

2009-07-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除