|
@@ -150,48 +150,46 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|
|
// For versions TBB 2021.7 and later this define is not required
|
|
|
#define TBB_PREVIEW_TASK_GROUP_EXTENSIONS 1
|
|
|
|
|
|
-//The only available version is 3, as of Boost 1.50
|
|
|
#include <boost/version.hpp>
|
|
|
|
|
|
+// As of Boost 1.50+, the only available version is 3,
|
|
|
+// Version 4 has been added in Boost 1.77
|
|
|
#define BOOST_FILESYSTEM_VERSION 3
|
|
|
-#if BOOST_VERSION > 105000
|
|
|
-# define BOOST_THREAD_VERSION 3
|
|
|
-#endif
|
|
|
#if BOOST_VERSION == 107400
|
|
|
# define BOOST_ALLOW_DEPRECATED_HEADERS
|
|
|
#endif
|
|
|
-#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
|
|
|
-//need to link boost thread dynamically to avoid https://stackoverflow.com/questions/35978572/boost-thread-interupt-does-not-work-when-crossing-a-dll-boundary
|
|
|
-//for example VCAI::finish() may freeze on thread join after interrupt when linking this statically
|
|
|
-#ifndef BOOST_THREAD_USE_DLL
|
|
|
-# define BOOST_THREAD_USE_DLL
|
|
|
-#endif
|
|
|
-#define BOOST_BIND_NO_PLACEHOLDERS
|
|
|
-
|
|
|
-#if BOOST_VERSION >= 106600
|
|
|
-#define BOOST_ASIO_ENABLE_OLD_SERVICES
|
|
|
-#endif
|
|
|
|
|
|
-#include <boost/algorithm/hex.hpp>
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
-#include <boost/crc.hpp>
|
|
|
-#include <boost/current_function.hpp>
|
|
|
#include <boost/container/small_vector.hpp>
|
|
|
#include <boost/container/static_vector.hpp>
|
|
|
-#include <boost/filesystem.hpp>
|
|
|
-#include <boost/filesystem/fstream.hpp>
|
|
|
+// C++ 20 -> std::source_location::function_name
|
|
|
+#include <boost/current_function.hpp>
|
|
|
+// C++ 17 -> std::filesystem
|
|
|
+#include <boost/filesystem/directory.hpp>
|
|
|
+#include <boost/filesystem/exception.hpp>
|
|
|
+#include <boost/filesystem/file_status.hpp>
|
|
|
+#include <boost/filesystem/operations.hpp>
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
#include <boost/format.hpp>
|
|
|
-#include <boost/functional/hash.hpp>
|
|
|
-#include <boost/lexical_cast.hpp>
|
|
|
-#ifdef VCMI_WINDOWS
|
|
|
-#include <boost/locale/generator.hpp>
|
|
|
-#endif
|
|
|
#include <boost/logic/tribool.hpp>
|
|
|
#include <boost/multi_array.hpp>
|
|
|
+// C++ 20 -> std::range
|
|
|
#include <boost/range/adaptor/filtered.hpp>
|
|
|
#include <boost/range/adaptor/reversed.hpp>
|
|
|
-#include <boost/range/algorithm.hpp>
|
|
|
+#include <boost/range/algorithm/copy.hpp>
|
|
|
+#include <boost/range/algorithm/count.hpp>
|
|
|
+#include <boost/range/algorithm/count_if.hpp>
|
|
|
+#include <boost/range/algorithm/fill.hpp>
|
|
|
+#include <boost/range/algorithm/find.hpp>
|
|
|
+#include <boost/range/algorithm/find_if.hpp>
|
|
|
+#include <boost/range/algorithm/max_element.hpp>
|
|
|
+#include <boost/range/algorithm/min_element.hpp>
|
|
|
+#include <boost/range/algorithm/remove.hpp>
|
|
|
+#include <boost/range/algorithm/remove_if.hpp>
|
|
|
+#include <boost/range/algorithm/replace.hpp>
|
|
|
+#include <boost/range/algorithm/sort.hpp>
|
|
|
+#include <boost/range/algorithm/unique.hpp>
|
|
|
+#include <boost/range/algorithm/upper_bound.hpp>
|
|
|
|
|
|
#ifndef M_PI
|
|
|
# define M_PI 3.14159265358979323846
|
|
@@ -201,7 +199,6 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|
|
/* Usings */
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
|
using namespace std::placeholders;
|
|
|
-namespace range = boost::range;
|
|
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
|
/* Typedefs */
|
|
@@ -340,7 +337,7 @@ namespace vstd
|
|
|
template <typename Container, typename Func>
|
|
|
int find_pos_if(const Container & c, const Func &f)
|
|
|
{
|
|
|
- auto ret = boost::range::find_if(c, f);
|
|
|
+ auto ret = std::find_if(c.begin(), c.end(), f);
|
|
|
if(ret != std::end(c))
|
|
|
return std::distance(std::begin(c), ret);
|
|
|
|
|
@@ -491,13 +488,13 @@ namespace vstd
|
|
|
template <typename Container, typename Item>
|
|
|
void erase(Container &c, const Item &item)
|
|
|
{
|
|
|
- c.erase(boost::remove(c, item), c.end());
|
|
|
+ c.erase(std::remove(c.begin(), c.end(), item), c.end());
|
|
|
}
|
|
|
|
|
|
template<typename Range, typename Predicate>
|
|
|
void erase_if(Range &vec, Predicate pred)
|
|
|
{
|
|
|
- vec.erase(boost::remove_if(vec, pred),vec.end());
|
|
|
+ vec.erase(std::remove_if(vec.begin(), vec.end(), pred), vec.end());
|
|
|
}
|
|
|
|
|
|
template<typename Elem, typename Predicate>
|
|
@@ -584,7 +581,7 @@ namespace vstd
|
|
|
* Current bugfix is to don't use a typedef for decltype(*std::begin(rng)) and to use decltype
|
|
|
* directly for both function parameters.
|
|
|
*/
|
|
|
- return boost::min_element(rng, [&] (decltype(*std::begin(rng)) lhs, decltype(*std::begin(rng)) rhs) -> bool
|
|
|
+ return std::min_element(rng.begin(), rng.end(), [&] (decltype(*std::begin(rng)) lhs, decltype(*std::begin(rng)) rhs) -> bool
|
|
|
{
|
|
|
return vf(lhs) < vf(rhs);
|
|
|
});
|
|
@@ -599,7 +596,7 @@ namespace vstd
|
|
|
* Current bugfix is to don't use a typedef for decltype(*std::begin(rng)) and to use decltype
|
|
|
* directly for both function parameters.
|
|
|
*/
|
|
|
- return boost::max_element(rng, [&] (decltype(*std::begin(rng)) lhs, decltype(*std::begin(rng)) rhs) -> bool
|
|
|
+ return std::max_element(rng.begin(), rng.end(), [&] (decltype(*std::begin(rng)) lhs, decltype(*std::begin(rng)) rhs) -> bool
|
|
|
{
|
|
|
return vf(lhs) < vf(rhs);
|
|
|
});
|