666

#include <iostream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <string.h>

using namespace std;

class Test
{
private:
    int x;
public:
    const Test operator+(Test t){return *this;}
    Test& operator+(Test t){return *this;}
    //返回值不可修改
    //对自己本身进行修改
    //返回值可做左值
    Test operator+(Test t)const{}
    //本身对象是不可修改的
    //const是加在*this上面的
    Test operator+(const Test t){}
    //传入的算子不能改变
    ++a
    const Test& operator++(){ }
    a++
    const Test operator++(int){}
};

int main()
{
    +-*/
    const T operator-(const T)const{}
    !&&
    bool operator!(const T)const{}
    []
    T& operator[](int index){}
    
}

  

posted @ 2019-04-25 20:41  -Asurada-  阅读(149)  评论(0编辑  收藏  举报