title: My explicit instantiation of template class seems doesn't work
body: <p>I wrote a short program to test the template class's explicit instantiation as follows:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template &lt;class T&gt;
  struct less_than_comparable {
      friend bool operator&gt;=(T const&amp; a, T const&amp; b) {
          return !(a &lt; b);
      }
  };
  
  class Point {
      friend bool operator&lt;(Point const&amp; a, Point const&amp; b) {
          return a.x_ &lt; b.x_;
      }
  
  public:
      Point(int x) : x_(x) {}
  
  private:
      int x_;
  };
  
  template struct less_than_comparable&lt;Point&gt;; 
  //Here I explicitly instantiate a template class expecting that 
  //less_han_comparable&lt;Point&gt; would export opeartor&gt;=() for class Point to the global
  //namespace, and then the p1 &gt;= p2 statement will work as expected.
  
  int main() {
      using namespace std;
  
      Point p1(1), p2(2);
      cout &lt;&lt; (p1 &lt; p2) &lt;&lt; endl;
      cout &lt;&lt; (p1 &gt;= p2) &lt;&lt; endl; //But I have a compiler error here saying that 
                                  //no match for ‘operator&gt;=’ in ‘p1 &gt;= p2’
  }
  </code></pre>
  
  <p>I know if I inherit Point from less_than_comparable, the code will pass the compiling. 
  <strong>But my question is why it doesn't work if I use explicit instantiation?</strong>
  I use G++ 4.4.5 running on Ubuntu 10.04.
  Any comments will be appreciated. Thanks.</p>