#include <iostream>

struct base
{
    virtual ~base() {}
    virtual void foo() const { std::cout << "base::foo\n" ; }
    void bar() const { std::cout << "base::bar\n" ; }
};

struct derived : base
{
    virtual void foo() const override
    { std::cout << "derived::foo overrides base::foo\n" ; }

    void bar() const
    { std::cout << "derived::bar hides base::bar\n" ; }
};

void fun( const base& b )
{
    b.foo() ;
    b.bar() ;
}

int main()
{
    derived d ;
    fun(d) ;
}
