源码部分 通过Sizzle.attr匹配出值 然后通过表达式刷选计算 "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( ...
分类:
其他好文 时间:
2014-07-22 22:51:56
阅读次数:
195
#include?<iostream>
#include?<algorithm>
using?namespace?std;
//回调函数
void?call_back(char?elem)
{
?cout?<<?elem?<<?endl;
}
//仿函数
struct?Functor
{
?void?operator()?(char?elem)...
分类:
其他好文 时间:
2014-07-22 08:13:37
阅读次数:
316
deque
------------------------------------------------------------------------
??一直看不懂 operator->() ,不明白它为什么不用接受参数,直接 return &(operator*())
好像我们用迭代器的时候也不没怎么用到这个函数,甚至我都不会用
1.概述
vector 是单向开口的连续线性空间,deque 则是一种双向开口的连续线性空间
允许常数时间内对起头端进行元素的插入和移除操作
没有容量概念,因为它是动...
分类:
其他好文 时间:
2014-07-22 00:32:34
阅读次数:
225
# include
# include
# include
using namespace std;
struct node
{
int pos;
int d;
int num;
friend bool operator n2.d;//仍的距离从小到大
return...
分类:
其他好文 时间:
2014-07-21 11:43:44
阅读次数:
180
假设你建立一个class 用来保存一个指针指向一块动态分配的位图。1 class Bitmap {......};2 class Widget{3 ...4 private:5 Bitmap* pb ;6 };1 Widget& Widget::operator= (con...
分类:
其他好文 时间:
2014-07-21 08:39:10
阅读次数:
145
vector
----------------------------------------------------------------------
描述:
1.迭代器
vector 维护的是一个连续线性空间,它的迭代器是普通指针,
能满足 RandomAccessIterator 所有必要条件:operator*, operator->,operator++,operator--,operator+,
operator-,operator+=,operator-=,operator[]
2.数据...
分类:
其他好文 时间:
2014-07-20 23:25:57
阅读次数:
378
在C++中所特有的另一种内置类型bool。它只是一种特殊情况,因为对于布尔值,我们并不需要像++这样的操作符。反之,我们需要特定的布尔操作符,例如&=和|=,因此,这个类型是单独定义的:
class Bool
{
public:
Bool(bool x=false)
: data_(x)
{
}
operator bool () const
{
return data_;
}...
分类:
其他好文 时间:
2014-07-20 10:47:16
阅读次数:
192
函数引用操作符
struct absInt
{
int operator()(int val) const
{
cout!!!"<<endl;
return val<0 ? -val : val;
}
};
void fun1()
{
int i=-42;
absInt absObj;
int ui=absObj...
分类:
编程语言 时间:
2014-07-20 10:32:09
阅读次数:
380
0.两个要点a) 一个空类,编译器自动合成默认无参构造函数、析构函数、拷贝构造函数、赋值运算符。b) 在编写类的时候,必须严格区分对象是否可复制。1.运算符重载之 string类1.1 运算符重载的几个要点:a) 运算符重载可以有成员函数和友元函数的形式,后者比前者多一个参数。b) =和+=必须重载...
分类:
编程语言 时间:
2014-07-19 18:30:05
阅读次数:
206
Description 请计算C[k]=sigma(a[i]*b[i-k]) 其中 k 11 #include12 const double PI=3.14159265359;13 struct P{double x,y;};14 P operator+(const P&a,const P&b){....
分类:
其他好文 时间:
2014-07-19 11:27:07
阅读次数:
178