As I understand, C++ in general features 'one-way' type checking. That is checking the sub-expressions and get their types, and see if the types so far satisfy the constraints imposed by the current expression node. It's an algorithm progressing from bottom to top.

However, C++ also features overloading and template. When you pass such a function directly as the argument to another function, during type checking we cannot immediately get the type of the sub-expression since it is overloaded or using template. So how does it work?

It's possible that C++ does more than 'one-way' type checking. If that's the case, please explain to me how the feature is implemented.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.