I had a question. In this case, while receiving a parameter as reference, will the compiler dereference the whole object?
class A {
int a;
};
void fun(A ¶m) {
// Play with param
}
int main() {
A *obj = new A();
fun(*obj); // Dereference the pointer and receive it as reference
}
So,
-
Will the compiler dereference the object?
-
How to verify whether the compiler is dereferencing or not?
Thanks
Chid
Aucun commentaire:
Enregistrer un commentaire