![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
jiamin0329
这个作者很懒,什么都没留下…
展开
-
Inside the C++ Object Model - 7. On the Cusp of the Object Model
1. Template// nullptr, no object is pointed to. Point<float> *ptr = 0;// it will instantiate a point instance// which will be converted to// Point<float> temp(float(0));// const Point<float> &ref = temp;const Point<float&g原创 2020-05-26 22:25:50 · 97 阅读 · 0 评论 -
Inside the C++ Object Model - 6. Runtime Semantics
It is not easy to predict the complexity of the function.原创 2020-05-26 21:57:56 · 127 阅读 · 0 评论 -
Inside the C++ Object Model - 5. Semantics of Construction, Destruction, and Copy
Abstract class cannot instantiate instance given pure virtual function exists.原创 2020-05-26 21:54:03 · 157 阅读 · 0 评论 -
Inside the C++ Object Model - 4. The Semantics of Function
Base2 *base2 = new Derived;// code will be converted to Derived *temp = new Derived;Base2 *base2 = temp ? temp + sizeof(base1) : 0;C++ critiaria - nonstatic member function has to perform no worse than nonmember function.Actually, compiler will e..原创 2020-05-26 00:35:32 · 104 阅读 · 0 评论 -
Inside the C++ Object Model - 3. The Semantics of Data
A char will be inserted into a class object if it is empty - 1 byte for an empty class object原创 2020-05-25 10:31:16 · 100 阅读 · 0 评论 -
Inside the C++ Object Model - 2. The Semantics of Contructors
Adefaultconstructorisaconstructorwhichcanbecalledwithnoarguments(eitherdefinedwithanemptyparameterlist,orwithdefaultargumentsprovidedforeveryparameter).Defaultconstuctoriscreatedbyuserorbycompilerwhenitisneeded....原创 2020-05-24 20:35:40 · 150 阅读 · 0 评论 -
Inside the C++ Object Model - 1. Object Lessons
C++ uses ADT(abstract data type)class Point3d{public: Point3d(float x=0.0,float y=0.0,float z=0.0):_x(x),_y(y),_z(z){} float x() {return _x;} float y() {return _y;} float z() {return _z;}private: float _x; float _y; float原创 2020-05-23 14:11:44 · 212 阅读 · 0 评论 -
General Sort Algorithm
1. Intersect Sortvoid IntersectSort(std::vector<int> &inVec){ int size = inVec.size(); for (int j = 1; j < size; ++j) { int key = inVec[j]; int i = j - 1; while (i >= 0 && key < inVec...原创 2020-05-21 20:40:42 · 124 阅读 · 0 评论