#include <iostream>
using namespace std;
struct base {
static void talk() { cout << "hello" << endl; }
static void shout() { cout << "HELLO!!" << endl; }
};
struct derived : public base {
static void talk() { cout << "goodbye" << endl; }
};
template < class T >
struct traits {
static void talk() { T::talk(); }
static void shout() { T::shout(); }
};
int main() {
traits<base>::talk();
traits<base>::shout();
traits<derived>::talk();
traits<derived>::shout();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IGJhc2UgewoJc3RhdGljIHZvaWQgdGFsaygpIHsgY291dCA8PCAiaGVsbG8iIDw8IGVuZGw7IH0KCXN0YXRpYyB2b2lkIHNob3V0KCkgeyBjb3V0IDw8ICJIRUxMTyEhIiA8PCBlbmRsOyB9Cn07CgpzdHJ1Y3QgZGVyaXZlZCA6IHB1YmxpYyBiYXNlIHsKCXN0YXRpYyB2b2lkIHRhbGsoKSB7IGNvdXQgPDwgImdvb2RieWUiIDw8IGVuZGw7IH0JCn07Cgp0ZW1wbGF0ZSA8IGNsYXNzIFQgPgpzdHJ1Y3QgdHJhaXRzIHsKCXN0YXRpYyB2b2lkIHRhbGsoKSB7IFQ6OnRhbGsoKTsgfQoJc3RhdGljIHZvaWQgc2hvdXQoKSB7IFQ6OnNob3V0KCk7IH0KfTsKCmludCBtYWluKCkgewoJdHJhaXRzPGJhc2U+Ojp0YWxrKCk7Cgl0cmFpdHM8YmFzZT46OnNob3V0KCk7Cgl0cmFpdHM8ZGVyaXZlZD46OnRhbGsoKTsKCXRyYWl0czxkZXJpdmVkPjo6c2hvdXQoKTsKCXJldHVybiAwOwp9