是否有可能做一些这样的: struct test
{
this
{
get { /*do something*/ }
set { /*do something*/ }
}
}
所以,如果有人试图做到这一点, test tt = new test();
string asd = tt; // intercept this and the
我试图建立一个非常简单的(现在)围绕INT包装类,并希望重载=操作符来实现类似以下内容: class IntWrapper
{
...
private:
int val;
}
int main ()
{
IntWrapper a;
int b;
a = 5; // uses overloaded = to implement