[mlpack-git] [mlpack] moving cliDeleter instance to log.cpp (#524)

Ryan Curtin notifications at github.com
Thu Feb 25 20:40:24 EST 2016


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 `#include <mlpack/core.hpp>` without using anything in it, you don't need to link against -lmlpack.)

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 `src/mlpack/core/util/singletons.cpp` 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.

What do you think?  Maybe there is something I have overlooked?

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

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/524#issuecomment-189073562
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160225/da1c4e47/attachment.html>


More information about the mlpack-git mailing list