码迷,mamicode.com
首页 >  
搜索关键字:operator-    ( 3564个结果
poj 3678 Katu Puzzle(2-sat)
DescriptionKatu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an i...
分类:其他好文   时间:2015-09-16 20:06:42    阅读次数:162
hdu2609最小表示法
#include #include #include #include #include using namespace std;const int maxn=10005;struct elem{ char str[105]; int len; bool operator = le...
分类:其他好文   时间:2015-09-15 16:15:43    阅读次数:170
c++中new/operator new/placement new
1. new/deletec++中的new(和对应的delete)是对堆内存进行申请和释放,且两个都不能被重载。2. operator new/operator deletec++中如果想要实现不同的内存分配行为,需要重载operator new,operator delete。operator n...
分类:编程语言   时间:2015-09-15 00:14:55    阅读次数:244
深入理解c++中的new与delete
一,new与delete的细节假如有下面的代码:string *sp = new string("a value");string *arr = new string[10];整个new的语句可以分为三步完成,首先,编译器使用名为operator new(operator new[])的标准库函数,...
分类:编程语言   时间:2015-09-13 23:09:18    阅读次数:267
实现C++ String类
头文件,函数大都隐式内联了。#ifndef MYSTRING_H#define MYSTRING_H#include #include class MyString { friend std::ostream& operator>(std::istream &, MyString &);public...
分类:编程语言   时间:2015-09-13 19:46:45    阅读次数:156
Effective C++ 条款52 写了placement new也要写placment delete
1. placement new和place ment delete指的是正常的operator new和operator delete的重载版本,所谓的正常的operator new和delete,指的是拥有以下正常签名式的版本:void* operator new(std::size_t) th...
分类:编程语言   时间:2015-09-13 07:03:43    阅读次数:230
Effective C++ 条款51 编写new和delete时需固守常规
1. 实现定制的operator new和operator delete需要满足一定的要求. 以operator new而言:实现一致性operator new必须返回正确的值;内存不足时必得调用new-handling函数;必须有对付零内存需求的准备;需避免不慎掩盖正常形式的new;如果有能力供....
分类:编程语言   时间:2015-09-13 02:06:47    阅读次数:246
Effective C++ 条款50 了解new和delete的合理替换时机
1. 替换标准库提供的operator new或operator delete通常基于以下三个理由: 1). 用来检测运行上的错误.将"new 所得内存"delete掉却不幸失败会导致内存泄露,多次对同一块"new所得内存"施行delete会导致未定义行为,如果让operator new持有一串动....
分类:编程语言   时间:2015-09-13 00:51:29    阅读次数:147
2015 IOS 学习笔记 界面图形计算器的制作——蓝懿教育
- (IBAction)calAction:(UIButton*)sender { self.number1= [self.resultLabel.textfloatValue]; self.operator= sender.tag; self.resultLabel.text=@"0"; ...
分类:移动开发   时间:2015-09-12 23:35:42    阅读次数:232
Effective C++ 条款49 了解new handler的行为
1. 当operator new无法满足某一内存分配需求时,它会先调用一个客户指定的错误处理函数(如果客户未指定,它就会抛出异常),所谓的new-handler.为了指定这个"用以处理内存不足"的函数,客户必须调用set_new_handler,那是声明于的一个标准库函数:namespace std...
分类:编程语言   时间:2015-09-12 22:14:04    阅读次数:293
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!