How to preserve const-ness of typedef'd types
<p>Every once in a while I get hung up by this and no one has really been able to give a satisfying answer.</p>

<p>In a (admittedly contrived) example like this...</p>

<pre><code>typedef std::string _str;
class MyClass
{
public:
    MyClass(const _str &amp;s) : m_str(s) { }
private:
    const _str &amp;m_str;
}
</code></pre>

<p>... Things work pretty much as expected. The member <code>m_str</code> can only be assigned in the constructor initializer list and cannot be reassigned later on, and non-const iterators are unavailable. Okay, then. But if we do this instead...</p>

<pre><code>typedef std::string _str;
typedef std::string &amp;_strref;
class MyClass
{
public:
    MyClass(const _strref s) : m_str(s) { }
    void test() { m_str.append(std::string("why am I not const?")); }
private:
    const _strref m_str;
}
</code></pre>

<p>... The const gets dropped. Non-cost methods may be called on <code>m_str</code> and it may be reassigned, which is misleading considering it has <code>const</code> written next to it.</p>

<ul>
<li>Can the second example be corrected to maintain const-ness?</li>
<li>Where/why does the c++ spec indicate that this is correct behavior?</li>
<li>What do best practices have to say on the matter?</li>
</ul>
