<p>I think the problem is the api do not allowed the users to specify the type at compile, either</p>

<p>1 : make TreeType as template parameter<br>
2 : use boost variant if you want to avoid code bloat(is this the reason you do not specify TreeTypes as template param?)</p>

<p>Example : </p>

<p><code>NSModel(TreeTypes treeType = TreeTypes::KD_TREE, bool randomBasis = false);</code></p>

<p>Make TreeTypes as</p>

<p><code>boost::variant&lt;TreeType::KDTree, TreeType::StandardCoverTree, /*and so on*/&gt;</code></p>

<p>TreeType::KDTree and other types could be empty class</p>

<pre><code>class KDTree
{
};
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/674#issuecomment-224048163">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGVIsZoUX9Nxo7Cmn-ALtdygoxpQks5qJGjLgaJpZM4It4UX">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEI36HMlFsQ3tpkPPGLTXGzesVBrks5qJGjLgaJpZM4It4UX.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/674#issuecomment-224048163"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>