ERROR: "dependent name is not a type". When use typedef type in class as return value, with template
<pre><code>template &lt;class Item&gt;
class bag
{
public:
    //TYPEDEF
    typedef size_t size_type;
    typedef Item value_type;
...
}
</code></pre>

<p>and when I use</p>

<pre><code>template&lt;class Item&gt;
bag&lt;Item&gt;::size_type bag&lt;Item&gt;::count(const Item&amp; target) const
</code></pre>

<p>VC++ report error as 
Source.cpp(207): warning C4346: 'bag::size_type' : dependent name is not a type</p>

<p>Could anybody show me why? Thanks!</p>
