title: How templates works when consumed by another module
body: <p>When creating, for instance, a generic linked list (denote it by <code>List&lt;T&gt;</code>), I was always told that if I use somewhere a <code>List&lt;int&gt;</code> and elsewhere a <code>List&lt;short&gt;</code> then actually the compiler would generate two different implementations of <code>List</code>, one using <code>int</code> and another using <code>short</code>. That makes sense to me and kind of reminds how <a href="http://sglib.sourceforge.net/" rel="nofollow">SGLIB</a> works in C.</p>
  
  <p>But I don't understand how the process works when using different compiled modules. I mean, if I make a library with a <code>List&lt;T&gt;</code>, which code is generated, given that it's impossible to know how the code will be consumed? The code for a <code>List&lt;char&gt;</code> would certainly compile very differently from the code of <code>List&lt;int&gt;</code>, so what's happening here?</p>