title: Alternative to declaring a type alias inside a class
body: <p>I am using a class (<code>sf::Texture</code>) from another library.
  I want to get the functionality of declaring a type alias inside that class, like:</p>
  
  <pre><code>class Texture
  {
  public:
      using ResourceId = TextureId;
      //...
  }
  </code></pre>
  
  <p>so that I can do this in my code:</p>
  
  <pre><code>enum class TextureId
  {
      texture1,
      texture2 //..etc
  }
  
  template&lt;class ResourceType&gt;
  class ResourceContainer
  {
  public:
      ResourceContainer();
  private:
      ResourceType* resource_;
      typename ResourceType::ResourceId id; // &lt;--- this will have TextureId type
                                            // when we create this object 
                                            // with &lt;sf::Texture&gt;
  }
  </code></pre>
  
  <p>However, as I mentioned, the <code>Texture</code> class is from another library so I can't edit its declaration.</p>
  
  <p>I tried to declare it in my code as <code>using sf::Texture::ResourceId = TextureId;</code> but it doesn't work(Cannot resolve the symbol <em>ResourceId</em>).</p>
  
  <p>So, is there an alternative to get the same functionality without adding <code>ResourceId</code> as the second template parameter?</p>
  
  <p>(using C++17)</p>