#include <iostream>
#include <vector>

using namespace std;

template< typename Self>
class A {
public:
    void foo( ) {
    	Self s;
    ( ( A< Self> &) s)._method( s);
    }

protected:
    virtual  void _method( const Self & b) = 0;
};

class _B;


class B : public A< B> {

protected:
    void _method( const B & b) { cout << "goo!"; }
};

int main() {
    B().foo();

	return 0;
}