Answering this question , I was a little embarrassed. We all know that this works great thanks to C ++ copy semantics:
int *some_obj = new int(42);
int a_copy = *some_obj;
delete some_obj;
printf("The answer is %d\n", a_copy);
But what about this?
int *some_obj = new int(42);
int& a_ref = *some_obj;
delete some_obj;
printf("The answer is %d\n", a_ref);
This access to remote memory?
Different times may be given in different forms, but it is not very friendly. Damn, I could not make a worthy title.
source
share