<p>Ooh, this is a really cool trick that Conrad wrote into Armadillo and I really like it. Inside of Mat_bones.hpp there are these lines, inside of the definition of the class <code>Mat</code>:</p>
<pre><code> public:
#ifdef ARMA_EXTRA_MAT_PROTO
#include ARMA_INCFILE_WRAP(ARMA_EXTRA_MAT_PROTO)
#endif
</code></pre>
<p>So if you've defined <code>ARMA_EXTRA_MAT_PROTO</code>, it just gets included right there in the class definition. The same is true in <code>Mat_meat.hpp</code>, and a few other files (including the cube files). This is really cool because it allows the class to be extensible. So I add the definitions of the functions in <code>Mat_extra_bones.hpp</code> and set that file to be <code>ARMA_EXTRA_MAT_PROTO</code>, then the implementations in <code>Mat_extra_meat.hpp</code>. I think it's a really cool trick. :)</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/513#issuecomment-181407286">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJfrKJjz1zdAM0feJ1pk81xgYf1cks5piKexgaJpZM4HQHGn.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/issues/513#issuecomment-181407286"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>