language: C++ 4.7.2 (gcc-4.7.2)
date: 398 days 7 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
 
void foo()
{
    std::cout << "global foo()" << std::endl;
}
 
struct A {
    void foo()
    {
    std::cout << "A::foo()" << std::endl;
    }
};
 
struct C {
 
};
 
template <typename T>
struct B : public T {
    void call()
    {
        T::foo();
    }
};
 
int main(int argc, char **argv )
{
    B<A> a;
    a.call();
 
    B<A> c;
    c.call();
    return 0;
}