wxAuiToolBar‘s overflow function cannot work as expected, when as pane in wxAuiManager, on GTK. ![1][1] ![2][2] 当增加一个AuiToolBar到一个auimanager之后,如果想用它的overflow feature,在gtk平台,无...
分类:
其他好文 时间:
2014-07-22 08:16:37
阅读次数:
228
#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
有时候指定了自己类类型来表示某种类型数据如SmallInt,那么为了方便计算就会指定一个转换操作符,将该类类型在某种情况下自动的转换为指定的类型
转换操作符
operator type();
转换函数必须是类成员函数,不能指定返回类型,并且形参列表必须为空,并且通常不应该改变转换对象,所以操作符通常定义为const成员。
#include
using namespace std;
cla...
分类:
编程语言 时间:
2014-07-21 13:32:27
阅读次数:
181
# 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
重载,转换,运算符
Conversion Operators
转换操作符
operator type() const
Conversions to
an array or a function type are not permitted.
转换函数必须是成员函数,不能指定返回 类型,必须有一个空的参数列表。
函数通常应 const。
Defining a Clas...
分类:
编程语言 时间:
2014-07-21 11:42:56
阅读次数:
227
假设你建立一个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