码迷,mamicode.com
首页 >  
搜索关键字:const 底层const 顶层const    ( 26295个结果
为何要防止隐式类型转换
让编译器进行隐式类型转换所造成的弊端要大于它所带来的好处,所以除非你确实需要,不要定义类型转换函数。隐式类型转换的缺点:它们的存在将导致错误的发生。例如:class Rational {public: ... operator double() const; // 转换Rational类成doubl...
分类:其他好文   时间:2014-07-02 00:09:52    阅读次数:261
前m大的数(哈希入门)&&sort
http://acm.hdu.edu.cn/showproblem.php?pid=1280普通方法(625ms)#include #include #include int b[3000*1501];int cmp(const void *a,const void *b){ return *...
分类:其他好文   时间:2014-07-01 21:55:11    阅读次数:185
leveldb源码分析--SSTable之TableBuilder
上一篇文章讲述了SSTable的格式以后,本文结合源码解析SSTable是如何生成的。void TableBuilder::Add(const Slice& key, const Slice& value) {//如果已经插入过数据,那么要保证当前插入的key > 之前最后一次插入的key,// S...
分类:数据库   时间:2014-07-01 21:34:56    阅读次数:469
连通区域
#include #include #include #include #include #include #include #include void icvprCcaByTwoPass(const cv::Mat& _binImg, cv::Mat& _lableImg){ // connect...
分类:其他好文   时间:2014-07-01 13:45:49    阅读次数:255
c语言学习之结构篇代码演示样例-输入n个同学的姓名,数学英语成绩,依照平均分从低到高排序并输出
#includevoid main(){const int count = 5;//定义数量struct student{char name[80];float math,eng;float aver;}stu[count],temp;//输入for (int i = 0; i stu[sub].a...
分类:编程语言   时间:2014-07-01 13:32:56    阅读次数:257
hdu 1532 Drainage Ditches(最大流)
题目:         链接:点击打开链接 题意:         求最大流速。 思路:         Edmond_karp就行。 代码: #include #include #include #include using namespace std; #define INF 100000000 const int N = 220; int cap[N][N],flo...
分类:其他好文   时间:2014-07-01 07:15:11    阅读次数:226
uva 11885 - Number of Battlefields(矩阵快速幂)
题目连接:uva 11885 - Number of Battlefields 题目大意:给出周长p,问多少种形状的周长为p的,并且该图形的最小包围矩阵的周长也是p,不包括矩形。 解题思路:矩阵快速幂,如果包含矩形的话,对应的则是斐波那契数列的偶数项,所以对应减去矩形的个数即可。 #include #include typedef long long ll; const l...
分类:其他好文   时间:2014-07-01 06:21:33    阅读次数:226
Codeforces 442B Kolya and Tandem Repeat(暴力)
题目连接:Codeforces 442B Kolya and Tandem Repeat 题目大意:给出一个字符串,可以再添加n个字符,问说可以找到SS的子串形式,S尽量长。 解题思路:枚举长度和起点判断即可,超过len的可以作为任意值,但是超过len+n就不行了。 #include #include const int N = 205; int n, len; char s...
分类:其他好文   时间:2014-06-30 20:21:48    阅读次数:220
C++11的thread代码分析
本文分析的是llvm libc++的实现:http://libcxx.llvm.org/ class thread thread类直接包装了一个pthread_t,在linux下实际是unsigned long int。 class thread { pthread_t __t_; id get_id() const _NOEXCEPT {return __t_;} } ...
分类:编程语言   时间:2014-06-30 19:29:24    阅读次数:257
如何禁止C++ 类支持拷贝
如何禁止C++ 类支持拷贝 C++ 编译器默默地为你做了不少工作 当你写下 class Empty {}; //其实等价于 class Empty { public: Empty() { ... } //default constructor Empty(const Empty &rhs) { ... } //copy constructor ~Empty() { ......
分类:编程语言   时间:2014-06-30 18:47:21    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!