Home >Backend Development >C#.Net Tutorial >What is the basis for judging overloaded methods in C++

What is the basis for judging overloaded methods in C++

王林
王林Original
2020-06-20 14:48:445016browse

What is the basis for judging overloaded methods in C++

#What is the basis for judging overloaded methods in c?

1. The number of function parameters;

(Recommended tutorial: c language tutorial)

2. The type of function parameters;

3. The order of formal parameters;

4. Constant function const can also be used as the basis for judging function overloading.

Reason: When overloading the [] operator, the difference between whether there is const is: if there is const, it can only be read, but if there is no const, it can be read and written.

Note: The return value cannot be used as a condition for function overloading. The reason is that the compiler will not determine the return type of the function during compilation. The compiler will verify the return type only after the function is called, so the return value cannot be used as the basis for function overloading.

The above is the detailed content of What is the basis for judging overloaded methods in C++. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn