title: calling a static method from template class from other file C++
body: <p>I want to have a class <em>Sorings</em> in which to realize some sorting methods by static methods with templates. I have read <a href="https://stackoverflow.com/questions/495021/why-can-templates-only-be-implemented-in-the-header-file">here</a> that static template methods should be realized in the .h file. Here is my code:</p>
  
  <p>Sortings.h</p>
  
  <pre><code>#ifndef SORTINGS_H_
  #define SORTINGS_H_
  
  template &lt;class T&gt;
  class Sortings {
  public:
      static void BubbleSort(T a[], int len, bool increasing)
      {
          T temp;
          for(int i = len-1; i &gt;= 1; i--)
              for(int j = 0; j&lt;= i-1; j++)
                  if(increasing ? (a[j] &gt; a[j+1]) : (a[j] &lt; a[j+1])) {
                      temp = a[j+1];
                      a[j+1] = a[j];
                      a[j] = temp;
                  }
      };
  };
  
  #endif /* SORTINGS_H_ */
  </code></pre>
  
  <p>Sortings.cpp</p>
  
  <pre><code>#include "Sortings.h"
  //empty?
  </code></pre>
  
  <p>Practice.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Sortings.h"
  int main() {
      int a[6] = {4,5,2,11,10,16};
      Sortings::BubbleSort&lt;int&gt;(a,6,true);
      return 0;
  }
  </code></pre>
  
  <p>but it returns the following errors: (the lines are like that because I have commented all the rest in Practice.cpp)</p>
  
  <pre><code>Description Resource    Path    Location    Type
  'template&lt;class T&gt; class Sortings' used without template parameters PracticeCpp.cpp /PracticeCpp/src    line 41 C/C++ Problem
  expected primary-expression before 'int'    PracticeCpp.cpp /PracticeCpp/src    line 41 C/C++ Problem
  Function 'BubbleSort' could not be resolved PracticeCpp.cpp /PracticeCpp/src    line 41 Semantic Error
  Symbol 'BubbleSort' could not be resolved   PracticeCpp.cpp /PracticeCpp/src    line 41 Semantic Error
  </code></pre>
  
  <p>I don't understand what the problem is. Can you help me understand what is wrong : conceptually or/and syntactically?</p>
  
  <p>I am running with Eclipse Neon.3 Release (4.6.3)</p>