#include <iostream>
#include <string>

class t_foo_base
{
public:
    t_foo_base(){};
    virtual ~t_foo_base(){}
    virtual std::string text( void ) const { return( "t_foo_base" ); };
};


class t_foo: public t_foo_base
{
public:
    t_foo(){};
    virtual std::string text( void ) const override { return( "t_foo" ); };
};

std::string test_foo(t_foo_base p)
{
	return p.text();
}

int main()
{
	t_foo_base* pBase = new t_foo;
	std::cout << test_foo(*pBase);
}