this post was submitted on 26 Oct 2025
8 points (100.0% liked)

Hacker News

2916 readers
475 users here now

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Cochise@lemmy.eco.br 1 points 1 week ago (1 children)
[–] whiwake@sh.itjust.works 1 points 1 week ago (1 children)

Yes. Which frequently leads to complications.

#include <iostream>
using namespace std;

void log(int level) {
    cout << "Logging numeric level: " << level << endl;
}

void log(string message) {
    cout << "Logging message: " << message << endl;
}

int main() {
    log('A');  // Uh oh — which one is this?
}
[–] ChairmanMeow@programming.dev 3 points 1 week ago

The level one. But that's more due to implicit casting rather than function overloading imo.