title: Using method from inherited template parameter class
body: <p>As shown in the code, I am inheriting the class <code>BoldPen</code>, obtained from the template parameter to another class <code>Writer</code>, and creating <code>writer1</code> object.</p>
  
  <p>My question is regarding the 'line of interest' marked in the code below. As it stands, the code compiles fine and works. However, if I remove the <code>PenType::</code> scope, changing the line to just <code>Write</code> the code fails compilation with error </p>
  
  <pre><code>main.cpp: In member function ‘void Writer&lt;PenType&gt;::StartWriting()’:
  main.cpp:17:11: error: there are no arguments to ‘Write’ that depend on a template parameter, so a declaration of ‘Write’ must be available [-fpermissive]
       Write();
             ^
  </code></pre>
  
  <p>From my understanding, shouldn't it compile fine since the <code>BoldPen</code> class is being inherited by <code>Writer</code>, which means it should see the <code>Write</code> method in its superclass <code>BoldPen</code>? Why is <code>PenType::</code> (I can see it useful if it were static member function, in which case there is no point (?) in inheriting it )</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  struct BoldPen
  {
    void Write()
    {
      std::cout &lt;&lt; "Writing using a boldpen" &lt;&lt; std::endl;
    }
  };
  
  template&lt;class PenType&gt;
  class Writer : public PenType
  {
  public:
    void StartWriting()
    {
      PenType::Write();     //#####LINE OF INTEREST##### Gives error when just Write();
    }
  };
  
  int main()
  {
  
    Writer&lt;BoldPen&gt; writer1;
    writer1.StartWriting();
    return 0;
  }
  </code></pre>
  
  <p><em>EDIT:</em></p>
  
  <p>Although the linked question (duplicate of) does answer the core reason behind it, I am more concerned with its effect on member functions after the inheritance is completed. Particularly, the syntax used is quite similar to how one would access static methods. Does that go well with dependent name lookup?Also see the comments for further info. Thanks.</p>