1、function/bind简介function是一种类模板,重载了operator()函数调用操作符,所以每一个function类的对象都是一个函数对象。bind是一种函数适配器,可以改变参数的个数、顺序。2、相关代码 1 #include 2 #include 3 #include 4 ...
分类:
其他好文 时间:
2014-10-11 04:30:04
阅读次数:
292
google hacking其实并算不上什么新东西,当时并没有重视这种技术,认为webshell什么的,并无太大实际用途.google hacking其实并非如此简单...常用的google关键字:foo1 foo2 (也就是关联,比如搜索xx公司 xx美女)operator:foofiletype...
分类:
其他好文 时间:
2014-10-10 17:38:54
阅读次数:
269
学习《深入探索》时,发现原文中提供的一个代码大致如下(书中第3页)1 class Point3d2 {3 inline ostream&4 operator 2 using namespace std; 3 4 class Point3d 5 { 6 private: 7 ...
分类:
其他好文 时间:
2014-10-10 14:45:34
阅读次数:
132
function是一种类模板,重载了operator()函数调用操作符,所以每一个function类的对象都是一个函数对象。我们可以这样使用function模板:#include #include #include #include using namespace std;void foo(cons...
分类:
编程语言 时间:
2014-10-10 14:37:10
阅读次数:
378
/*
学习心得:
1、 此栈用链表实现,与上面的用数组实现不一样;用到了模板类Stack
2、 此类用到了复制构造函数 Stack(const Stack &original),运算符重载函数
Stack& operator = (const Stack &original)
3、 初始化的默认构造方式Stack():top(NULL) {},记住类中声明的函数不可以有函数体的,
但是空函数体(只有{})是可以的...
分类:
编程语言 时间:
2014-10-10 12:08:34
阅读次数:
597
#-*-coding:utf-8-*-__author__='Administrator'fromPyQt4importQt,QtCore,QtGuiimportsys,random,operator,decimal,threading,time,winsoundclassE_24(QtGui.QD...
分类:
其他好文 时间:
2014-10-09 18:27:37
阅读次数:
1014
29.避免返回内部数据的句柄。
即使声明一个类的对象为const,不能进行修改,在获得其数据的句柄也就是地址的情况下,还是可以强行修改的。
class A{
public:
int n;
A(int x):n(x){}
operator int*() const;
};
inline A::operator int*()const{
return const_cast(&n);
}...
分类:
编程语言 时间:
2014-10-09 15:34:28
阅读次数:
208
error LNK2019: 无法解析的外部符号 对‘operator const&)’未定义的
分类:
其他好文 时间:
2014-10-09 14:46:48
阅读次数:
222
时间限制:0.5s空间限制:6M题意: 给出长n(n#include #include using namespace std;struct Mat { int mat[100][100];} mx;int pow[109];int n, m, mod, len;Mat operator ...
分类:
其他好文 时间:
2014-10-09 13:21:33
阅读次数:
183
这里我们给出一个使用RTTi的例子;考虑一个类层次,我们希望为它实现 operator==相等操作符:如果两个对象的给定数据成员集合的值相同,则它们就相等。每个派生类可以增加自己的成员,当然,测试相等的时候也要包含这些数据。对于类层次中有两个类型(一个基类,一个派生类),按照一般的方法,我们就需要实...
分类:
编程语言 时间:
2014-10-09 12:54:53
阅读次数:
381