In C++ how is function overloading typically implemented?

后端 未结 8 1905
醉酒成梦
醉酒成梦 2020-12-09 04:07

If there is no function overloading, the function name serves as the address of the function code, and when a function is being called, its address is easy to find using its

8条回答
  •  再見小時候
    2020-12-09 04:43

    Overloaded functions are resolved at compile-time. The compiler finds a suitable match for the given set of parameters and simply calls the corresponding function by its address (void foo(int) and void foo() are practically two totally independent functions - if you have foo(4) in your code, the compiler knows which function to call).

提交回复
热议问题