I saw this code but I couldn’t understand what it does:
inline S* O::operator->() const
{
return ses; //ses is a private member of Type S*
}
so what happens now if I used ->?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is you have an instance of class O and you do
then the operator-> returns ses and then it uses the returned pointer to call func().
Full example: