C ++ - function overloading, name mangling

A function overloaded
C ++ allows the function of the same name in the same action statement of several functionally similar domain, which shape function parameter list of the same name (the number or type or order parameter) must be different.
The principle function overloading
the function name, the domain and the list of parameters, the three must be identical, will conflict.
Second, the name mangling
in C language, the name mangling is _ the function name, so long as the same function name, it will lead to conflict
in the C ++ language:? The domain name of the function @ 1 @ 2 @ @ domain format constitute the argument list @Z

int func(int) ? Func @@ yahh @ Z
int C::func(int) ?func@C@@AAEHH@Z
int C::C2::func(int) ?func@C2@c@@AAEHH@Z
Published 77 original articles · won praise 23 · views 7558

Guess you like

Origin blog.csdn.net/Hots3y/article/details/100524834