一、C++默默编写并调用了哪些函数 当你写下: class CEmpty { } 这就好像你写下 class CEmpty { public: CEmpty(){…} CEmpty(const CEmpty &rhs){…} ~CEmpty(){…} CEmpty& operator=(const ...
分类:
其他好文 时间:
2015-01-16 12:41:08
阅读次数:
128
转自:http://blog.sina.com.cn/s/blog_4cf015f201009o1d.html第一种情况作为Stringizing Operator(#),暂叫字符串化吧。#define stringer( x ) printf( #x "\n" ) int main() { ...
分类:
编程语言 时间:
2015-01-15 17:46:48
阅读次数:
202
简单了写了query和list的实现,特将代码放在这里,以备后续查看。
query:
QueryItem.h
#ifndef QUEUEITEM
#define QUEUEITEM
#include
using namespace std;
template class Queue;
template
ostream& operator &);
template
istream&...
分类:
其他好文 时间:
2015-01-15 14:16:38
阅读次数:
97
b = operator.itemgetter(1) 定义函数b,用于获取传入list的第1域的值
可以将b用于sort函数的key。作为排序的依据。
adn_app_data_map是个字典
for key, app_arr in adn_app_data_map.items():
app_arr.sort(key=operator.ite...
分类:
编程语言 时间:
2015-01-14 16:51:53
阅读次数:
205
如:string a("sky1"),b("sky2") ;b = a ;程序在运行的时候创建了两个对象,分别是a和b,然后调用构造函数。当执行“b=a”的时候,因为没有用户自己定义的赋值运算符函数,于是程序自动调用默认的赋值函数,两个指针指向了同一个内存,“sky2”这个空间的内存应经不能访问了。...
分类:
编程语言 时间:
2015-01-14 06:15:58
阅读次数:
201
Extension Method: Return another string if string is null or emptyJust a tiny little extension method. You may know the ?? operator for null checks:va...
分类:
其他好文 时间:
2015-01-13 23:00:25
阅读次数:
211
#includeusing namespace std;class String{ friend ostream& operator=0&&e<=strlen(m_data)) return m_data[e];}ostream& operator<<(ostream& os,String& str...
分类:
其他好文 时间:
2015-01-12 22:13:28
阅读次数:
159
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT. 1 public class Solution { 2 public ...
分类:
其他好文 时间:
2015-01-12 00:18:28
阅读次数:
293
1.BNF范式%token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)"unticked_statement:| expr ';' { zend_do_free(&$1 TSRMLS_CC); }expr: r...
分类:
Web程序 时间:
2015-01-11 22:51:50
阅读次数:
366
这里是用 JavaScript 做的逆转序列(数组/字符串)的递归/尾递归实现。另外还尝鲜用了一下 ES6 的destructuring assignment + spread operator 做了一个更 functional 的版本(只支持数组)。正确性能通过测试(参见 放在我 Github 上...
分类:
编程语言 时间:
2015-01-11 06:12:23
阅读次数:
283