Given this code:
int& some_class::ret_ref(){
return this->some_integer;
}
int* some_class::ret_ptr(){
return &(this->some_integer);
}
int main(){
some_class c;
auto p=c.ret_ptr();
auto r=c.ret_ref();
}
At compile time:
pisint*risint
Why was auto deduced as int* in p and it was not deduced as int& in r?
What is the rule here?