Skip to content

Instantly share code, notes, and snippets.

@onqtam
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onqtam/9310790 to your computer and use it in GitHub Desktop.
Save onqtam/9310790 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct A {
void a() { cout << "a()" << endl; }
void a(int in) { cout << "a(int)" << endl; }
};
struct B : public A {
void a() { cout << "OVERLOAD" << endl; }
};
int main(int argc, char** argv) {
B temp;
temp.a();
temp.a(6); // error: no matching function for call to 'B::a(int)'
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment