代码如下:
struct A
{
static int k;
int i;
};
int A::k = 10;
A func() { A a; return a; }
我的问题是,我如何判断是否func().k
是func().i
左值?如果两者都是左值/右值,我该如何测试它们?
func().k = 0; // compile ok under g++-4.4 and g++-4.6
func().i = 1; // compile ok with g++-4.4, but g++-4.4 gives an error:
//"using temporary as lvalue [-fpermissive]"