Replace Boost with standard library features wherever possible
For the 4.0 release, we should minimize the Boost dependency for higher portability and better compiler error messages. Here is a list of Boost libraries and what should happen with them.
No API change:
-
static_assert
-
cstdint
-
type_traits
-
mpl
(should be rewritten to use standard template functionality) -
enable_if
-
lexical_cast
-
bind
-
random
-
math
-
thread
-
range
-
chrono
-
date_time
-
exception
-
foreach
No visible API change:
-
make_shared
,shared_ptr
,weak_ptr
,dynamic_ptr_cast
(because they are imported into the walberla namespace: -
function
(because implicitly convertible)
API change:
-
regex
-
tuple
(should be changed to use variadic templates instead. Also,TypeList
should use variadic templates instead of its customboost::tuple
clone) -
array
,shared_array
-
filesystem
(use C++17 version if available, else fall back to boost) -
optional
(use C++17 version if available, else fall back to boost) -
any
(use C++17 version if available, else fall back to boost)
Rewrite without Boost:
-
algorithm::string
(replace with appropriate<algorithm>
s and lambda functions) -
functional::hash
-
integer
-
checked_delete
-
numeric::conversion::cast
-
lambda::bind
-
cast
-
dynamic_bitset
(replace withstd::vector<bool>
) -
logic::tribool
(replace withwalberla::optional<bool>
or anenum
) -
uuid
(only used as random numbers, so just generate two 64-bit integers, set the type bits as required and print them as a hex string with dashes in the right places) -
units::detail::utility::demangle
-
multi_array
(replace withstd::vector
or evenstd::array
with appropriate index arithmetic)
Keep:
python
property_tree
graph
Finally:
-
Modify the build system to make Boost an optional dependency (if std::filesystem
,std::optional
andstd::any
have been found) and disablepython_coupling
,config::configToBoostPropertyTree
, andmath::EquationSystem
if Boost is not found.
Edited by Michael Kuron