(接上篇http://www.cnblogs.com/daipeiwu/p/4134694.html)重写* 1 BigInteger operator * (const BigInteger& b){ 2 BigInteger c,d; 3 c.s.clear();...
分类:
其他好文 时间:
2014-12-09 21:08:19
阅读次数:
400
CByteBuffer使用static void Main(){ BYTE a; short b; int c; CByteBuffer buffer; buffer CByteBuffer& operator nCapacity) { ...
分类:
编程语言 时间:
2014-12-09 17:08:13
阅读次数:
344
set:插入后自动按从小到大的顺序排列,如果是结构体的话需要重载#include using namespace std;typedef struct tagStudentInfo{ int nID; string strName; bool operator setS; sInfo stu...
分类:
其他好文 时间:
2014-12-09 00:15:50
阅读次数:
186
#include<iostream>
usingnamespacestd;
template<classT>
classTest;//模板类前置声明
template<classT>
ostream&operator<<(ostream&out,constTest<T>&obj);//模板类友元前置声明
template<classT>
classTest
{
public:
fri..
分类:
其他好文 时间:
2014-12-08 12:31:42
阅读次数:
124
STL是建立在泛化之上的。数组泛化为容器,参数化了所包含的对象的类型。函数泛化为算法,参数化了所用的迭代器的类型。指针泛化为迭代器,参数化了所指向的对象的类型。STL中的六大组件:容器、算法、迭代器、配置器、适配器、仿函数。
这六大组件中在容器中分为序列式容器和关联容器两类,正好作为STL源码剖析这本书的内容。迭代器是容器和算法之间的胶合剂,从实现的角度来看,迭代器是一种将operator*、o...
分类:
其他好文 时间:
2014-12-08 00:55:58
阅读次数:
213
不同平台下,同一段代码的结果竟然有如此大的差距,两个运算符的不同组合,碰撞出的火花有点儿让我这个小白Hold不住了,求大神解救!...
分类:
其他好文 时间:
2014-12-06 21:34:49
阅读次数:
201
如果编写的判断式不满足strict weak ordering,就会出现Invalid operator< assertion error错误。网页:http://support.microsoft.com/kb/949171VS(其他编译器还没试过)中,sort函数要求比较函数是strict we...
分类:
其他好文 时间:
2014-12-06 20:13:54
阅读次数:
182
新语法:自动属性;隐式类型var;参数默认值和命名参数;对象初始化器和集合初始化器{};匿名类和匿名方法;扩展方法;系统内置委托Func/Action;Lambda表达式;标准查询运算符Standard query operator;LINQ查询表达式;
分类:
其他好文 时间:
2014-12-06 18:03:21
阅读次数:
154
1.C++具有完善的异常捕获机制,采用try{} catch(){}机制,这是C语言无法比拟的2.常见的几种异常:bad_alloc: 请求分配内存失败, operator new 或者 operator new []bad_exception:函数异常,通常是函数运行错误,抛出的异常bad_typ...
分类:
编程语言 时间:
2014-12-06 16:42:25
阅读次数:
218
定义一个节点:#include
using namespace std;
typedef int T;
struct Node{
T data;
Node* next;
Node(const T& d):data(d), next(NULL){}
operator T(){
return data;
}
};
int main(){
Node a(10), b(20);...
分类:
编程语言 时间:
2014-12-05 22:45:18
阅读次数:
254