4 ms·
No I meant parameter-based function overloading like C++ has (or is it not the wrong term? I forget). So like: int do_something(int param); int do_som
by simias 9y ago
No I meant parameter-based function overloading like C++ has (or is it not the wrong term? I forget).
So like:
int do_something(int param);
int do_something(double param, char *param2);
I don't see how you can avoid some form of name mangling since obviously you can't just define two duplicate "do_something" symbols.
- steveklabnik 9y agoRust does not currently support parameter-based function overloading, and there are no plans to in the near-term, if ever. (This isn't the only way to end up with duplicate symbols, just trying to make it clear that this specifically won't be a problem with Rust.)
- Someone 9y agoNitpick: C11 introduced support for some form of that kind of overloading, using _Generic macros. See http://en.cppreference.com/w/c/language/generic http://en.cppreference.com/w/c/language/generic, https://stackoverflow.com/questions/9804371/syntax-and-sample-usage-of-generic-in-c11 https://stackoverflow.com/questions/9804371/syntax-and-sampl..., https://stackoverflow.com/questions/40096584/c11-generic-usage https://stackoverflow.com/questions/40096584/c11-generic-usa.... Ugly? Yes, IMO, but it also is useful.