Recently I've seen this C++ standard paragraph (http://eel.is/c++draft/expr.post#expr.call-5):
If the postfix-expression designates a destructor, the type of the function call expression is void; otherwise, the type of the function call expression is the return type of the statically chosen function (i.e., ignoring the virtual keyword), even if the type of the function actually called is different. This return type shall be an object type, a reference type or cv void.
I don't really understand this part:
the type of the function call expression is the return type of the statically chosen function (i.e., ignoring the virtual keyword), even if the type of the function actually called is different.
- What is the statically chosen function here?
- How virtual function can be statically chosen? I've always thought that it's chosen at the runtime.
even if the type of the function actually called is different.
How a call expression can actually call function of the different type that was chosen?