Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
edflsafoiewq
5 months ago
|
parent
|
context
|
favorite
| on:
Things Zig comptime won't do
std::enable_if exists to disable certain overloads during overload resolution. Zig has no overloading, so it has no equivalent.
matklad
5 months ago
[–]
I'd flip it over and say that C++ has overloading&SFINAE to enable polymorphism which it otherwise can't express.
edflsafoiewq
5 months ago
|
parent
[–]
Such as? The basic property of overloading is it's open. Any closed set of overloads can be converted to a single function which does the same dispatch logic with ifs and type traits (it may not be very readable).
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: