Factory Function taking an Enum argument
<p>How can I avoid the fact that not all control paths return a Container here: </p>

<pre><code>        enum Type {Int, String};

        Container containerFactory(Type type)
        {
            switch(type)
            {
            case Int:
                return Container (std::vector&lt;int&gt;());
            case String: 
                return Container (std::vector&lt;std::string&gt;());
            }
        }
</code></pre>

<p><strong>UPDATE:</strong>
I was thinking that I could cast an exception here but I can't unit test this as it isn't possible to pass an invalid Type to the function.</p>
