Nested type as function argument
<p>I have the following template class:</p>

<pre><code>
template&lt;class T&gt;
class C
{
    typedef C_traits&lt;T&gt;                traits;
    typedef typename traits::some_type type;
    //...
    // use 'traits' and 'type' a lot
    //...
};
</code></pre>

<p>where <code>C_traits</code> is a template struct that has a typedef for <code>some_type</code> that is different for each specialization of the type <code>X</code>. I am trying to write a function that receives a reference to a variable of <code>type</code> as defined above, i.e.:</p>

<pre><code>
template&lt;class T&gt;
//void f(const C_traits&lt;T&gt;::some_type& c)     &lt;-- this does not work either
void f(const C&lt;T&gt;::type& c)
{
    //...
}
</code></pre>

<p>I'm getting an "expected unqualified-id before '&amp;' token" error on the line where f is defined. I think I understand why I am getting this error, but I'd like to know if there is any way to accomplish what I'm trying to do here.</p>

<p>Put another way, I'd like to do something like this:</p>

<pre><code>
template&lt;class T&gt;
void f(typename const C&lt;T&gt;::type& c)
{
    //...
}
</code></pre>

<p>which is not allowed. Any thoughs?</p>
