一、编写vector.pkg
class vector {
TOLUA_TEMPLATE_BIND(T, string, CCSprite*) // 添加我们想要的容器类型
void clear();
int size() const;
const T& operator[](int index) const;
T& operator[](i...
分类:
其他好文 时间:
2014-08-25 15:04:54
阅读次数:
1517
Problem X
Huge Mod
Input: standard input
Output: standard output
Time Limit: 1 second
The operator for exponentiation is different from the addition, subtraction, multiplication or division opera...
分类:
其他好文 时间:
2014-08-25 11:55:14
阅读次数:
249
如果一个class已经有了bitwise copy语意,所以implict copy assignment operator被视为毫无用处,也根本不会被合成出来,这一点和copy constructor一样的
一个 class对于默认的copy assignment operator,在以下情况下不会表现出bitwise copy语意
1、当class内带一个member object,而其c...
分类:
其他好文 时间:
2014-08-25 11:54:44
阅读次数:
163
如果一个类没有定义默认构造函数,那么构造该类的对象数组将会是一个问题。于是实现了一个将new操作符掰开了来用的代码。首先分配内存,然后再在分配的内存上调用构造函数构造对象,下面的代码做一个简单的备忘。
//没有定义构造函数的类不能定义该类的对象数组,内置类型除外
//operator new + ctor
//dtor + operator delete
//operator new[] ...
分类:
其他好文 时间:
2014-08-24 11:44:02
阅读次数:
147
Divide two integers without using multiplication, division and mod operator.常常出现大的负数,无法用abs()转换成正数的情况class Solution{private: vector f;public: in...
分类:
其他好文 时间:
2014-08-23 17:43:11
阅读次数:
215
简单DP题。可以用运算符重载来写,简单一些。#include #include #include #include using namespace std;class STRS{public: char str[100]; void operator=(STRS b){ strcpy(str,b.....
分类:
其他好文 时间:
2014-08-23 12:31:20
阅读次数:
235
MFC编码时报错:
显示:error C2248: “CObject::operator =”: 无法访问 private 成员(在“CObject”类中声明)
这种问题是你刚开始声明的是指针类型变量,后来又改为了非指针型,最好直接改为指针型变量。...
分类:
其他好文 时间:
2014-08-23 10:02:00
阅读次数:
156
Precedence
Operator
Description
Example
Associativity
1
()
[]
->
.
::
++
--
Grouping operator
Array access
Member access from a pointer
Member access from an object
Scoping operat...
分类:
编程语言 时间:
2014-08-22 17:50:09
阅读次数:
279
1,创建测试数据库,表;2,数据库连接对象函数sqlite3是数据库连接对象(database connection object),用来操作数据库(operator DBs);打开数据库对象函数(open db object function),int sqlite3_open(const cha...
分类:
数据库 时间:
2014-08-22 00:13:05
阅读次数:
395
仿函数是行为类似函数的类或结构体,类或结构体重载了operator(),它比函数指针更加灵活易用。...
分类:
其他好文 时间:
2014-08-19 16:43:15
阅读次数:
245