title: Why the linker complains about multiple definitions in this template?
body: <p>This little piece of code triggers the linker's anger when included on at least two translation units (cpp files) :</p>
  
  <pre><code># ifndef MAXIMUM_HPP
  # define MAXIMUM_HPP
  
  template&lt;typename T&gt;
  T maximum(const T &amp; a, const T &amp; b)
  {
      return a &gt; b ? a : b ;
  }
  
  /* dumb specialization */
  template&lt;&gt;
  int maximum(const int &amp; a, const int &amp; b)
  {
      return a &gt; b ? a : b ;
  }
  
  # endif // MAXIMUM_HPP
  </code></pre>
  
  <p>But compiles and links fine with one translation unit. If I remove the specialization, it works fine in all situations. Here is the linker message :</p>
  
  <pre><code>g++ -o test.exe Sources\test.o Sources\other_test.o
  Sources\other_test.o:other_test.cpp:(.text+0x0): multiple definition of `int maximum&lt;int&gt;(int const&amp;, int const&amp;)'
  Sources\test.o:test.cpp:(.text+0x14): first defined here
  </code></pre>
  
  <p>Aren't templates allowed to be instantiated multiple times ? How to explain this error and how to fix it ?</p>
  
  <p>Thanks for any advice !</p>