#include <iostream>
#include <memory>

using namespace std;


struct Interf {
    virtual void test() {cout << "I am Interf" << endl;}
};

struct A {
    A(std::unique_ptr<Interf> e) : _e(std::move(e)) {}

    std::unique_ptr<Interf> _e;

    void test() {_e->test();}

};



struct Impl : public Interf {
    void test() {cout << "I am Impl;" << endl;}
};



int main()
{
    std::unique_ptr<Interf> b(new Impl);

    A a(std::move(b));

    a.test();


    cout << "fine!" << endl;
    return 0;
}
