- 博客(16)
- 资源 (2)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 Think_in_CPP读书笔记目录
12 操作符重载 12.1 重载方式 12.1.1 全局函数方式 12.1.2 成员函数方式 12.2 一元操作符(Unary operators) 12.2.1 全局函数重载方式 12.2.2 成员函数重载方式
2012-09-17 20:23:52
205
原创 用Docker安装Redmine
1、软件环境Ubuntu 20.042、安装Docker2.1、安装GPG证书curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -2.2、写入软件源信息 sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs)
2022-01-25 16:14:31
2328
原创 Python模块查找路径
Python通过import来加载模块。加载前首先按照如下顺序查找模块文件:1、需要加载模块的Python文件所在目录。例如: A.py在/opt/test目录下,A.py需要加载B.py,则运行A.py时首先会查找/opt/test目录。2、PYTHONPATH环境变量指定的路径例子:PYTHONPATH="/Library/Python/2.7/site-packages:{$PYTHONPATH}"3、标准连接库目录4、.pth文件中列出的目录.pth后缀文件中每一行代表一
2022-01-09 20:48:47
1653
转载 成为Java高手需要注意的25个学习目标
地址: http://developer.51cto.com/art/200906/131417.htm1.你需要精通面向对象分析与设计(OOA/OOD)、涉及模式(GOF,J2EEDP)以及综合模式。你应该了解UML,尤其是class,object,interaction以及statediagrams。2.你需要学习Java语言的基础知识以及它的核心类库(collections,
2012-11-22 21:08:42
248
原创 在线技术手册集合
C++在线手册STL容器: http://www.cplusplus.com/reference/stl/C++在线手册STL算法: http://www.cplusplus.com/reference/algorithm/GCC online documentation : http://gcc.gnu.org/onlinedocs/Libc库:http://www.gnu.org/
2012-09-29 09:26:24
312
原创 jsoncpp-C++开发的JSON库
1.准备工作源代码下载地址:http://sourceforge.net/projects/jsoncpp安装sconsyum install scons.noarch环境:Linux: Fedora 16GCC: 4.6.3jsoncpp: 0.5.02.编译解压源代码文件,进入到解压后的源代码目录执行命令: scons platform
2012-09-28 20:25:01
529
原创 Think_in_CPP第十三章 动态建立对象(1)
13.1 new和delete13.1.1 单个对象的建立与删除MyType *fp = new MyType(1,2); //1,2是构造函数的参数MyType *fg = new MyType; // 要有无参数的构造函数,或者是用户没有定义编译器提供 // 的无参数构造函数(所谓的默认构造函数default constructor)MyType *fg
2012-09-19 21:24:36
212
原创 Think_in_CPP第十二章 操作符重载(7)
12.11 自动类型转换(Automatic type conversion)#include using namespace std; class One { public: int i; One() { i=1; cout << "One" << i<< endl;} }; class Two { int i; public: Tw
2012-09-17 19:53:08
344
原创 Think_in_CPP第十二章 操作符重载(6)
12.6 成员函数还是全局友元函数 什么时候以成员函数的形式重载运算符号?什么时候以友元函数的形式?如果两者都可以的话,建议使用成员函数的形式。而在有的情况下必须使用成员函数的形式,比如()。在有的情况下必须用友元函数的形式,如左值是其他类的对象的情况。>习惯性的将stream类放在左边,因此在对>进行重载一般采用友元函数的形式。12.7 Overloading a
2012-09-16 20:47:14
473
原创 Think_in_CPP第十二章 操作符重载(5)
12.5.5 操作符->*和()的重载在重载->*之前,要先重载()。()操作的类型是->*返回的类型。operator()用来建立所谓的函数对象(function object)。()必须作为成员函数来重载,且可以带任意数量的参数,下面是一个例子:class LessThan { public: LessThan( int val ) : _val( val ){}
2012-09-16 20:23:14
319
原创 Think_in_CPP第十二章 操作符重载(4)
12.5 其他操作符12.5.1 操作符[ ]class IntArray { enum { sz = 5 }; int i[sz]; public: IntArray() { memset(i, 0, sz* sizeof(*i)); } int& operator[](int x) { require(x >= 0 && x < sz,
2012-09-15 20:44:01
458
原创 Think_in_CPP第十二章 操作符重载(3)
12.4 操作符重载中的参数和返回值12.4.1 单目运算符全局函数方式const Integer& operator+(const Integer& a); const Integer operator-(const Integer& a); const Integer operator~(const Integer& a); Integer* operat
2012-09-15 11:55:01
275
原创 Think_in_CPP第十二章 操作符重载(2)
12.3 二元运算符(Binary operators)12.3.1 全局函数方式 class Integer { long i; public: Integer(long ll = 0) : i(ll) {} // Operators that create new, modified value: friend const Integer operator
2012-09-15 08:59:30
330
原创 Think_in_CPP第十二章 操作符重载(1)
12.1 重载方式操作符有两种重载方式:成员函数和全局函数。以Integer类来说明这两种方式。12.1.1 全局函数方式class Integer { long i; Integer* This() { return this; } public: Integer(long ll = 0) : i(ll) {} // No side effects take
2012-09-14 22:28:29
407
原创 C++ 配置类
参考资料: http://www.cnblogs.com/rosesmall/archive/2012/04/25/2470204.html1.类声明和定义Config.h#pragma once #include #include #include #include #include /*
2012-09-14 21:58:20
254
原创 编写Qt线程类
1.定义自己的线程类MyThread.h#include class MyThread : public QThread{public: void run();};MyThread.cpp#include "MyThread.h" void MyThread::run(){}2.使用线程类包含头文件:
2012-09-14 21:22:40
250
Learning the vi Editor_ 6th Edition
2009-06-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人