title: Template class not found when calling from static template function
body: <p>file securityController.h (shortened)</p>
  
  <pre><code>#ifndef SECURITYCONTROLLER_H_
  #define SECURITYCONTROLLER_H_
  
  #include "hallSensor.h"
  #include "project.h"
  
  template&lt;Axis axis&gt;
  class SecurityController{
  public:
  static void saturate(double&amp; value){
      HallSensor&lt;X&gt;::isAtEnd();   // DOES NOT WORK, nor do the other calls
  }
  };
  #endif /* SECURITYCONTROLLER_H_ */
  </code></pre>
  
  <p>file hallSensor.h (shortened)</p>
  
  <pre><code>#ifndef HALLSENSOR_H_
  #define HALLSENSOR_H_
  #include "project.h"
  #include "control.h"
  
  template&lt;Axis axis&gt;
  class HallSensor{
  
  private:
  static volatile bool triggered[2];
  static volatile bool state[2]; //the real current state
  static volatile int triggeredPosition[2];
  
  public:
  static bool isAtEnd(){
      return triggered[1];
  }
  };
  
  template&lt;Axis axis&gt; volatile bool HallSensor&lt;axis&gt;::triggered[2];
  template&lt;Axis axis&gt; volatile bool HallSensor&lt;axis&gt;::state[2];
  template&lt;Axis axis&gt; volatile int HallSensor&lt;axis&gt;::triggeredPosition[2];
  
  template&lt;&gt; bool HallSensor&lt;ALL&gt;::init();
  
  #endif /* HALLSENSOR_H_ */
  </code></pre>
  
  <p>This works: (main.cpp)</p>
  
  <pre><code>#include "hallSensor.h"
  int main(){
  HallSensor&lt;X&gt;::isAtEnd(); } //WORKS
  </code></pre>
  
  <p>The calls inside securityController.h do not work. Gcc/c++ outputs the following:</p>
  
  <pre><code>securityController.h: In static member function 'static void    SecurityController&lt;axis&gt;::saturate(double&amp;)':
  securityController.h:19:3: error: 'HallSensor' was not declared in this scope
  HallSensor&lt;X&gt;::isAtEnd();
  ^
  securityController.h:19:16: error: '::isAtEnd' has not been declared
  HallSensor&lt;X&gt;::isAtEnd();   //and so on
  </code></pre>
  
  <p>Axis is a simple enum with values for X,Y,Z,All</p>
  
  <p>Why can I call the static template function from a regular function, but not from inside a static template function?</p>