ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.17k forks source link

Minimize our Boost usage, where we can use std equivalents #3060

Open bobsummerwill opened 8 years ago

bobsummerwill commented 8 years ago

Find-in-files shows me the following dependencies:

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/trim_all.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/detail/endian.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/info_tuple.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/functional/hash.hpp>
#include <boost/integer/static_log2.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/distributions/normal.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/progress.hpp>
#include <boost/random.hpp>
#include <boost/random/random_device.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/regex.hpp>
#include <boost/test/included/unit_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
#include <boost/throw_exception.hpp>
#include <boost/timer.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/utility.hpp>
#include <boost/version.hpp>

And via json_spirit:

#include <boost/config.hpp> 
#include <boost/cstdint.hpp> 
#include <boost/shared_ptr.hpp> 
#include <boost/variant.hpp> 
chriseth commented 8 years ago

What is the goal in minimizing boost usage?

bobsummerwill commented 8 years ago

Reducing maintenance costs and simplifying the codebase.

I suspect (though I would be happy to be proven wrong) that we are over-using Boost, where std alternatives are available.

bobsummerwill commented 8 years ago

Thanks for the title update, @chriseth. That is better!

chriseth commented 8 years ago

I would say that boost is boost, once we use some of it, there is not much harm in using all of it. This is of course different for header-only modules and modules that need source files. In general, I think it should not have high priority.