keithw/mosh — pull request #158 by kmcallister (2012-04-12 07:16:45+00:00)
Title: Remove Boost dependency

There are various objections to our use of Boost:

* When you install the Boost header package, some distributions will grab 100 MB of Boost binary packages, none of which we use.

* Worse still, Gentoo will spend hours compiling them.

* The version of Boost that ships with RHEL/CentOS 5 is too old for Mosh. You can get a newer one from [EPEL](http://fedoraproject.org/wiki/EPEL), but a great many potential Mosh users can't install new packages, and just want to build Mosh in their homedir.

* We'd have to do something for Android as well.

I managed to replace all our uses of Boost with vanilla C++98 constructs.

* `BOOST_AUTO` is easy enough. We just spell out the type names, and add a few typedefs to make it more compact.

* `boost::lambda` is trickier. We replace some of it (particularly `for_each` and `find_if`) with ordinary loops. Other bits use the awful C++98 faux-functional stuff: `std::mem_fun_ref`, `std::bind2nd`, etc. This seems worthwhile for `remove_if`, where the equivalent loop is bigger, trickier, and depends on the container type.

Builds on GNU/Linux with g++ 4.1.2 (EL5), g++ 4.6.3, or clang++ 3.0.