title: Why can't I access and use a member type aliases from an object?
body: <p>Is it impossible to access a type alias (or <code>typedef</code>) of a templated class, from an object of that class? For example, why isn't the following possible:</p>
  <pre><code>template &lt;typename TKey, typename TData&gt;
  class MyClass
  {
  public:
      using key_t = TKey;
      using data_t = TData;
      TKey key;
      TData data;
      MyClass(TKey _key, TData _data) : key(_key), data(_data) {  }
  };
  
  int main() {
      MyClass&lt;int, float&gt; mc{1, 1.0f};
      using DataType = typename mc.data_t; //error: expected ';' after alias declaration
      mc.data_t newData = 2.0f; //error: Cannot refer to type member in 'MyClass&lt;int,float&gt; with '.'
  
      return 0;
  }
  </code></pre>
  <p>Is there another way to do something like this?</p>