constoverload.h.svn-base
来自「QT方面的开发」· SVN-BASE 代码 · 共 23 行
SVN-BASE
23 行
#ifndef CONSTOVERLOAD_H#define CONSTOVERLOAD_H#include <iostream>class Point3 { /* 3-dimension point (of double) */ public: friend std::ostream& operator<<(std::ostream& out, const Point3& v); Point3(double x = 0, double y = 0, double z = 0); double& operator[](int index); const double& operator[](int index) const; /* overloaded on const-ness */ Point3 operator+(const Point3& v) const; Point3 operator-(const Point3& v) const; Point3 operator*(double s) const; /* scalar multiplication */ private: static const int cm_Dim = 3; double m_Coord[cm_Dim];};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?