title: Code obfuscation in heavily templated library
body: <p>Large portion of our commercial C++ library relies on templates. We plan to sell our product as header files and dynamically linked libraries (closed-source), but because most of our code base is concentrated in headers, we would de facto be releasing it as open-source with small, easily replaceable chunks missing.</p>
  
  <p>Here is an example of what one of our classes from library interface look like:</p>
  
  <pre><code>template&lt;class ItInput, class ItOutput&gt;
  struct serialize{
    ItOutput operator() (ItInput first, ItInput last, ItOutput d_first) {
      // operation on pointers (assuming that ++, -- and * operators work as expected for pointers) 
  } 
  </code></pre>
  
  <p>Is there a way to provide level of obfuscation to our templated code equal to or better than compilation of regular code (i.e. technically reversible but not profitable nor optimal to do so)?</p>
  
  <p>EDIT: To clarify, our goal is to prevent users from reading the implementation, not prevent unlawful copying of our work. For the sake of the question please assume we have a valid reasons for this requirement. </p>