Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Name mangling
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Simple example==== A single C++ translation unit might define two functions named {{code|f()}}: <syntaxhighlight lang="cpp"> int f () { return 1; } int f (int) { return 0; } void g () { int i = f(), j = f(0); } </syntaxhighlight> These are distinct functions, with no relation to each other apart from the name. The C++ compiler will therefore encode the type information in the symbol name, the result being something resembling: <syntaxhighlight lang="cpp"> int __f_v () { return 1; } int __f_i (int) { return 0; } void __g_v () { int i = __f_v(), j = __f_i(0); } </syntaxhighlight> Even though its name is unique, {{code|g()}} is still mangled: name mangling applies to ''all'' C++ symbols (except for those in an <syntaxhighlight lang="cpp" inline>extern "C"{}</syntaxhighlight> block).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)