Typedef in class
<p>There is such code:</p>

<pre><code>template &lt;class T&gt;
class SomeClass{
    typedef boost::shared_ptr&lt;T&gt; sPtr;
    typedef std::vector&lt;sPtr&gt; c;
    typedef c::iterator cIt;  // here is the problem
};
</code></pre>

<p>and the error is:</p>

<pre><code>main.cpp:23: error: type ‘std::vector&lt;boost::shared_ptr&lt;X&gt;, std::allocator&lt;boost::shared_ptr&lt;X&gt; &gt; &gt;’ is not derived from type ‘SomeClass&lt;T&gt;’
main.cpp:23: error: expected ‘;’ before ‘cIt’
</code></pre>

<p>How to use typedef to templated parameters in class?</p>

<p>EDIT:</p>

<p>I figured it out, for g++ that must be:</p>

<pre><code>typedef typename c::iterator cIt;  // here is the problem
</code></pre>

<p>Please close it.</p>
