码迷,mamicode.com
首页 >  
搜索关键字:operator-    ( 3564个结果)
C++进阶--解谜operator new/delete
什么是operator new/delete?如何重载它们?什么情况下需要自己定义它们? ...
分类:编程语言   时间:2018-12-27 00:26:56    阅读次数:243
c/c++ 重载运算符 类型转换运算符
重载运算符 类型转换运算符 问题:能不能把一个类型A的对象a,转换成另一个类型B的对象b呢?? 是可以的。这就必须要用类型A的类型转换运算符(conversion operator) 下面的operator int()const{return val;}就是重载了的类型Int的类型转换运算符 注意: ...
分类:编程语言   时间:2018-12-26 20:15:22    阅读次数:193
operator ->
//The arrow operator has no inputs. Technically, it can return whatever you want, but it should return something that either is a pointer or can becom ...
分类:其他好文   时间:2018-12-26 10:29:28    阅读次数:177
c/c++ 重载运算符 标准库function的用法
重载运算符 标准库function的用法 问题:int(int, int)算不算一种比较通用的类型?? 比如函数: int add(int a, int b); 比如lambda:auto mod = \ "" {return a % b}; 比如函数对象类:int operator()(int a ...
分类:编程语言   时间:2018-12-25 23:42:38    阅读次数:295
c/c++ 重载运算符 函数调用运算符
重载运算符 函数调用运算符 把一个类的对象a,当成函数来使用,比如a(),所以需要重载operator()方法。重载了函数调用运算符的类的对象,就是函数对象了。 还有什么是函数对象呢??? lambda是函数对象 std::bind函数的返回值是函数对象 函数是函数对象 函数指针是函数对象 那函数对 ...
分类:编程语言   时间:2018-12-25 22:54:30    阅读次数:221
C++之max和max_element
C++之max和max_element std::max() Returns the greater of and , or the values in initializer list 。it can use operator include include int main() { std::c ...
分类:编程语言   时间:2018-12-24 22:06:06    阅读次数:600
自加自减运算符重载
#include using namespace std; class CDemo { private: int n; public: CDemo(int i = 0):n(i){} CDemo& operator++(); CDemo operator++(int); operator int()... ...
分类:其他好文   时间:2018-12-23 23:51:41    阅读次数:180
prime docker-compose 环境运行试用
prime 是一款基于graphql的开源cms,功能点很不错,但是出来不久,还是有好多bug的 官方暂时没有提供docker 的运行方式,为了方便测试,搞了以及docker-compose 测试的 环境准备 docker-copose 文件 version: "3" services: postg ...
分类:其他好文   时间:2018-12-23 22:18:32    阅读次数:243
C++进阶--编译器自动生成的类函数
```c++ // / 在C++ 03标准下 在没有显式定义的情况加,编译器会自动生成以下4个函数 1. 拷贝构造函数 2. 拷贝赋值运算符 3. 析构函数 4. 默认构造函数(只有当没有声明任何构造函数的时候) / class dog {}; / 这个看似空的类,其实等效于下面这个类 / clas ...
分类:编程语言   时间:2018-12-23 19:34:49    阅读次数:251
LA3890 Most Distant Point from the Sea
题意 "PDF" 分析 可以二分答案,检验就用半平面交,如果平面非空则合法。 时间复杂度$O(T n \log^2 n)$ 代码 ...
分类:其他好文   时间:2018-12-23 15:21:47    阅读次数:118
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!