example_c11.cpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <iostream>

void foo(int value) {
    std::cout << "Integer overload: " << value << std::endl;
}

void foo(void* ptr) {
    std::cout << "Pointer overload: " << ptr << std::endl;
}

int main() {
    foo(nullptr);  // Clearly calls foo(void*)
    return 0;
}
Back to nullptr