3 ms·
I want to pass a function as a pointer even though it is overloaded. C++ supports that. For instance if we do: int (*p)(int, int) = add; overload resolutio
by kazinator 11y ago
I want to pass a function as a pointer even though it is overloaded. C++ supports that. For instance if we do:
int (*p)(int, int) = add;
overload resolution kicks in there.
I want detailed error messages about overload resolution. Maybe not all the time: give me the executive summary ("no suitable overload of add was found") and the details if I specify some "-Woverload-detailed" option or whatever. That's a quality of implementation matter; neither ISO C nor ISO C++ spell out what diagnostics should look like and how detailed they should be.
Token-level macros are hacky cruft that shouldn't be used as the development bed for new features, period. All this stuff ignores 35 years of progress in the C dialect scene alone, not to mention 60 years of progress in general.
Above, add isn't even what is understood in computing as a "first class function". If we make it into some hacky macro, we are taking away even that second class status away from it.
- nothrabannosir 11y ago> I want to pass a function as a pointer even though it is overloaded. C++ supports that. That's his point: C _Generic and C++ are not the same. Which one is better was not his point, just that they're different.
- kazinator 11y ago> Which one is better was not his point, ... The comment is loaded with judgment, and the word "better" actually occurs.