a const reference cant use the const pointer
struct A{
void f(){
}
void f() const{
}
};
struct B{
void f1(){
a->f();
}
void f1() const{
a->f();
}
A *a;
};
int main(int argc, char *argv[])
{
A a;
B b;
b.a = &a;
b.f1();
const B& d = b;
d.f1();
return 0;
}