Cannot apply const to typedef reference
<p>The following code works when applying <code>const</code> to a return value reference of <code>value_type&amp;</code> but errors if I use a typedef of the same type.</p>

<p>As an example:</p>

<pre><code>class T {
};

class A {
public:
    typedef T value_type;
    typedef value_type&amp; reference;

    // Not working
    const reference operator*() const;

    // But this works?
    //const value_type&amp; operator*() const;
};

// Error!
const typename A::reference A::operator*() const {
}

int main() {
    return 0;
}
</code></pre>

<p>g++ will error with:</p>

<pre><code>'const' qualifiers cannot be applied
</code></pre>

<p>My actual code uses templates but I've removed for the example and substituted class <code>T</code> instead. This has no bearing on the error.</p>

<p>I don't see why this won't work if specifying <code>value_type&amp;</code> instead compiles fine.</p>