#include <iostream>

template<typename T>
struct Bar
{
    typedef void (T::*F)();
    
    Bar( T& t_ , F f ) : t( t_ ) , func( f )
    {
    }
    
    void operator()()
    {
        (t.*func)();
    }
            
    F func;
    T& t;
};

template<typename T>
class Foo
{
private:
	void foo()
	{
        std::cout << "Foo<T>::foo()" << std::endl;
	}
    
public:    
	Foo() : bar( *this , &Foo::foo ) 
	{
        bar();
	}
    
    Bar<Foo<T> > bar;
};

int main()
{
	Foo<int> foo;
}