<blockquote>
<p>since we would still have to write an operator() for each possible TreeType</p>
</blockquote>
<p>Maybe template can help?</p>
<pre><code>class ReferenceSet: public boost::static_visitor<void>
{
public:
template<typename T>
void operator()(T *tree) const
{
tree->ReferenceSet();
}
};
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<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-224364544">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFK7Q4q8ZTiTfXITf5gWmJyUZerjrks5qJbMGgaJpZM4It4UX">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFMuWQ0CDYf8tOv0p25zvFeG-K1klks5qJbMGgaJpZM4It4UX.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-224364544"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>