title: A question about Template in C++
body: <p>I know the basics of templates in C++, but I am still learning it.
  I have a question regarding to the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class PNG {
  public:
      static void draw() {
          cout&lt;&lt;"PNG drawing"&lt;&lt;endl;
      }
  };
  
  template &lt;typename Image&gt;
  void draw() {
      Image::draw();
  }
  
  
  int main() {
  
      draw&lt;PNG&gt;();
  }
  </code></pre>
  
  <p>the function <code>draw()</code>, I pass the type <code>Image</code> to it, and it will use <code>draw()</code> method of the <code>Image</code>.</p>
  
  <pre><code>template &lt;typename Image&gt;
      void draw() {
          Image::draw();
      }
  </code></pre>
  
  <p>Here, I pass <code>Image</code> and want to use <code>draw()</code> method inside of <code>Image</code>, but template function <code>draw()</code> has no parameter. So my question is, if I call this template function <code>draw()</code> in <code>main</code> in this way: <code>draw&lt;PNG&gt;();</code> is it allowed?
  And how the template function <code>draw()</code> knows the <code>PNG</code> is a class, and how the class member function <code>draw()</code> is called?</p>