On 21/09/2007, Michiel de Bondt <[EMAIL PROTECTED]> wrote:
> Using strings to show my point was not a good idea. You can add a field
> "int number" to the struct and perform similar operations (with =
> instead of strcpy).

I believe Andrew's right and the strcpy case is valid, but you do have
a point. I think this should be rejected:

struct A { int i; };
struct B { A get() { return A(); } };

int main ()
{
    B b;
    b.get().i = 0;
    // int& error = b.get().i;
}

Reply via email to