title: Is there the possibility of having one version of machine code for all template arguments of a templated function?
body: <p>Some people <a href="https://stackoverflow.com/questions/4133307/here-different-instances-are-generated-for-this-template-function-or-not">here</a> told it's not possible and some people <a href="https://stackoverflow.com/questions/4223603/why-is-passing-this-kind-of-variable-size-parameter-by-value-impossible">here</a> told it might be possible to have one version of machine code for all different template arguments of a templated function, so I thought it would be profitable to open a thread regarding this specific matter, if there is not such possibility that's it, if there is, in what situations can we count on this?
  An example that was specifically considered in both mentioned threads is below:</p>
  
  <pre><code>template&lt;size_t num&gt;    
  struct Elements{
   public:
    SomeType elements[num];
  };
  
  template&lt;size_t num&gt;
  void print(const Elements&lt;num&gt; &amp; elements,size_t size){
   //all instances do exactly same thing and with regard to Size that determines the size of object
  }
  </code></pre>
  
  <p>and of course there's pass by value version also:</p>
  
  <pre><code>template&lt;size_t num&gt;
  void print(const Elements&lt;num&gt; elements,size_t size){
   //all instances do exactly same thing and with regard to Size that determines the size of object
  }
  </code></pre>