Is this a correct Factory Method implementation? I'm learning about design pattern and I tried to implement a Factory Method example, based on the GoF book.   

Can I say that this is a correct implementation of it ? If not I will be glad to find out what are the pitfalls. 

#include &lt;iostream&gt;
#include &lt;vector&gt;
using namespace std;


class Widget {
public:
    virtual void draw() = 0;
};

class Win7Widget : public Widget {
public:
    void draw() { cout &lt;&lt; "Win 7 widget" &lt;&lt; endl; }
};

class Win8Widget : public Widget {
public:
    void draw() { cout &lt;&lt; "Win 8 widget" &lt;&lt; endl; }
};


class Factory {
public:
    virtual Widget* Create() = 0;
    virtual ~Factory() {}
};

class Win7Factory: public Factory {
public:
    Widget* Create() { return new Win7Widget; }
};

class Win8Factory: public Factory {
public:
    Widget* Create() { return new Win8Widget; }
};


int main()
{
    unique_ptr&lt;Factory&gt; win7fact(new Win7Factory);
    unique_ptr&lt;Factory&gt; win8fact(new Win8Factory);

    vector&lt;Widget*&gt; widgets;
    widgets.push_back(win7fact-&gt;Create());
    widgets.push_back(win8fact-&gt;Create());

    for(const auto&amp; f : widgets)
    {
        f-&gt;draw();
    }

    return 0;
}
Don't use dynamic allocation if automatic objects will do:

unique_ptr&lt;Factory&gt; win7fact(new Win7Factory);
unique_ptr&lt;Factory&gt; win8fact(new Win8Factory);


Should be:

Win7Factory win7fact;
Win8Factory win8fact;