#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 100000000
using namespace std;
struct node{
int b,p;
bool operator <(const node& a)con...
分类:
其他好文 时间:
2015-05-05 09:00:49
阅读次数:
132
在定义hash_map容器的时候,不仅需要指定键和值的类型,还需要指定hash函数和相等函数
(一)hash_map 的hash函数
hash到底是什么样子?看看源码:
struct hashint> {
size_t operator()(int __x) const { return __x; }
};
原来是个函数对象。在SGI S...
分类:
编程语言 时间:
2015-05-05 08:55:34
阅读次数:
313
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 100000000
using namespace std;
struct node{
int x,y;
bool operator < (const ...
分类:
其他好文 时间:
2015-05-04 18:06:21
阅读次数:
100
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.解题思路:既然不呢个用乘除和取模运算,只好采用移位运算,可以通过设置一个leng...
分类:
编程语言 时间:
2015-05-04 17:20:02
阅读次数:
149
元素保证是连续存储了 operator[]之类的不可以invalidate iterator了,于是COW不行了 不再是container所以swap不需要遵守不能copy/move/swap元素的规定,于是SSO可行了 reference不再是Allocator::reference了,而直接就是...
分类:
编程语言 时间:
2015-05-04 13:23:38
阅读次数:
128
1,#和##操作符Operator,使用 首个参数返回为一个带引号的字符串predefined variablewas not declared in the scope;2,调试debuging program,like breakpoint;abort();把此函数放置于你想一终端语句的下一行;...
分类:
其他好文 时间:
2015-05-03 23:40:21
阅读次数:
270
#include using namespace std;class Test1
{
public:
Test1()
{
//赋值
//p=NULL;
// or p=new int; }
//重要
Test1& operator=(const Test1& test1)
{
i...
分类:
编程语言 时间:
2015-05-03 14:39:17
阅读次数:
109
size_tsize_t. A basic unsigned integer C/C++ type. It is the type of the result returned by sizeof operator. The type's size is chosen so that it coul...
分类:
编程语言 时间:
2015-04-30 17:49:26
阅读次数:
135
public class fdgfg{ Vector v; public fdgfg() { v = new Vector(); } public void produceExpression(int bit,char operator) { ...
分类:
其他好文 时间:
2015-04-30 17:48:25
阅读次数:
137
所谓运算符重载,可以简单理解为函数的重载,而operator@就是函数名,@表示任何运算符,加减乘除等。#include using namespace std;class Complex{public: Complex(){real = 0; imag = 0;}; Complex(d...
分类:
编程语言 时间:
2015-04-30 00:52:54
阅读次数:
202