<p>There is... one other possibility.  This could be appealing if the idea of getting all of the classes associated with CLI or mlpack inside of libmlpack.so, and it's also appealing from a code size reduction standpoint.  (I think this also means that if you just <code>#include &lt;mlpack/core.hpp&gt;</code> without using anything in it, you don't need to link against -lmlpack.)</p>

<p>The idea is to make ProgramDoc a singleton of its own, then make the PROGRAM_INFO() macro a call to access the ProgramDoc singleton and set its parameters.  The ProgramDoc singleton can then be put into some file like <code>src/mlpack/core/util/singletons.cpp</code> which can also contain the CLI and Log objects (technically the Log objects aren't singletons, they're global variables, but hey, I couldn't think of a better name for it...).  Then we can control the order of construction (and thus destruction) and can eliminate the need for CLIDeleter entirely.</p>

<p>What do you think?  Maybe there is something I have overlooked?</p>

<p>Thanks for looking into this, by the way.  The CLI module hasn't gotten much attention since it was written in 2011. :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/524#issuecomment-189073562">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFKXa1qzp7RdIkvh_N11PlLe-sHW1ks5pn6SIgaJpZM4HiVT8.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/pull/524#issuecomment-189073562"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>