diff --git a/CMakeLists.txt b/CMakeLists.txt index dc8126418a..c4f52368bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,8 @@ if (MSVC) _CRT_SECURE_NO_WARNINGS WIN32_CONSOLE NOMINMAX + # TODO: Resolve these warnings, don't just silence them + _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS $<$,$>:_CRTDBG_MAP_ALLOC>) target_link_libraries (common INTERFACE @@ -369,7 +371,6 @@ add_library (opts INTERFACE) add_library (Ripple::opts ALIAS opts) target_compile_definitions (opts INTERFACE - BOOST_NO_AUTO_PTR BOOST_ASIO_HAS_STD_ARRAY BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS $<$: diff --git a/src/ripple/app/paths/impl/PaySteps.cpp b/src/ripple/app/paths/impl/PaySteps.cpp index 23e398676f..dc299657de 100644 --- a/src/ripple/app/paths/impl/PaySteps.cpp +++ b/src/ripple/app/paths/impl/PaySteps.cpp @@ -25,9 +25,7 @@ #include #include -#include -#include - +#include #include #include @@ -209,7 +207,7 @@ toStrandV1 ( // Note that for offer crossing (only) we do use an offer book even if // all that is changing is the Issue.account. STPathElement const* const lastCurrency = - *boost::find_if (boost::adaptors::reverse (pes), hasCurrency); + *std::find_if (pes.rbegin(), pes.rend(), hasCurrency); if ((lastCurrency->getCurrency() != deliver.currency) || (offerCrossing && lastCurrency->getIssuerID() != deliver.account)) { @@ -472,7 +470,7 @@ toStrandV2 ( // Note that for offer crossing (only) we do use an offer book // even if all that is changing is the Issue.account. STPathElement const& lastCurrency = - *boost::find_if (boost::adaptors::reverse (normPath), + *std::find_if (normPath.rbegin(), normPath.rend(), hasCurrency); if ((lastCurrency.getCurrency() != deliver.currency) || (offerCrossing && @@ -731,7 +729,8 @@ toStrands ( // Insert the strand into result if it is not already part of the vector auto insert = [&](Strand s) { - bool const hasStrand = boost::find (result, s) != result.end (); + bool const hasStrand = + std::find (result.begin(), result.end(), s) != result.end (); if (!hasStrand) result.emplace_back (std::move (s)); diff --git a/src/ripple/beast/container/detail/aged_ordered_container.h b/src/ripple/beast/container/detail/aged_ordered_container.h index 4cdbb4ba24..13483040ff 100644 --- a/src/ripple/beast/container/detail/aged_ordered_container.h +++ b/src/ripple/beast/container/detail/aged_ordered_container.h @@ -163,9 +163,17 @@ private: // VFALCO TODO This should only be enabled for maps. class pair_value_compare : public boost::beast::detail::empty_base_optimization +#ifdef _LIBCPP_VERSION , public std::binary_function +#endif { public: +#ifndef _LIBCPP_VERSION + using first_argument = value_type; + using second_argument = value_type; + using result_type = bool; +#endif + bool operator() (value_type const& lhs, value_type const& rhs) const { return this->member() (lhs.first, rhs.first); @@ -193,9 +201,17 @@ private: // VFALCO TODO hoist to remove template argument dependencies class KeyValueCompare : public boost::beast::detail::empty_base_optimization +#ifdef _LIBCPP_VERSION , public std::binary_function +#endif { public: +#ifndef _LIBCPP_VERSION + using first_argument = Key; + using second_argument = element; + using result_type = bool; +#endif + KeyValueCompare () = default; KeyValueCompare (Compare const& compare) diff --git a/src/ripple/beast/container/detail/aged_unordered_container.h b/src/ripple/beast/container/detail/aged_unordered_container.h index 7dda0d07f8..024ef9a70b 100644 --- a/src/ripple/beast/container/detail/aged_unordered_container.h +++ b/src/ripple/beast/container/detail/aged_unordered_container.h @@ -164,9 +164,16 @@ private: // VFALCO TODO hoist to remove template argument dependencies class ValueHash : private boost::beast::detail::empty_base_optimization +#ifdef _LIBCPP_VERSION , public std::unary_function +#endif { public: +#ifndef _LIBCPP_VERSION + using argument_type = element; + using result_type = size_t; +#endif + ValueHash () { } @@ -196,9 +203,17 @@ private: // VFALCO TODO hoist to remove template argument dependencies class KeyValueEqual : private boost::beast::detail::empty_base_optimization +#ifdef _LIBCPP_VERSION , public std::binary_function +#endif { public: +#ifndef _LIBCPP_VERSION + using first_argument_type = Key; + using second_argument_type = element; + using result_type = bool; +#endif + KeyValueEqual () { } diff --git a/src/ripple/beast/cxx17/type_traits.h b/src/ripple/beast/cxx17/type_traits.h index 7b5048c3cd..6a6dba8488 100644 --- a/src/ripple/beast/cxx17/type_traits.h +++ b/src/ripple/beast/cxx17/type_traits.h @@ -28,11 +28,19 @@ namespace std { #ifndef _MSC_VER -template -using void_t = void; + #if ! __cpp_lib_void_t -template -using bool_constant = std::integral_constant; + template + using void_t = void; + + #endif // ! __cpp_lib_void_t + + #if ! __cpp_lib_bool_constant + + template + using bool_constant = std::integral_constant; + + #endif // ! __cpp_lib_bool_constant #endif diff --git a/src/ripple/ledger/impl/CashDiff.cpp b/src/ripple/ledger/impl/CashDiff.cpp index dc045f0f56..eb651c12e7 100644 --- a/src/ripple/ledger/impl/CashDiff.cpp +++ b/src/ripple/ledger/impl/CashDiff.cpp @@ -263,11 +263,12 @@ getCashFlow (ReadView const& view, CashFilter f, ApplyStateTable const& table) auto each = [&result, &filters](uint256 const& key, bool isDelete, std::shared_ptr const& before, std::shared_ptr const& after) { - - std::find_if (filters.begin(), filters.end(), - [&result, isDelete, &before, &after] (FuncType func) { - return func (result, isDelete, before, after); + auto discarded = + std::find_if (filters.begin(), filters.end(), + [&result, isDelete, &before, &after] (FuncType func) { + return func (result, isDelete, before, after); }); + (void) discarded; }; table.visit (view, each); diff --git a/src/ripple/peerfinder/impl/Bootcache.h b/src/ripple/peerfinder/impl/Bootcache.h index 336023ef93..eb45bc81e3 100644 --- a/src/ripple/peerfinder/impl/Bootcache.h +++ b/src/ripple/peerfinder/impl/Bootcache.h @@ -84,10 +84,18 @@ private: using map_type = boost::bimap ; using value_type = map_type::value_type; - struct Transform : std::unary_function < - map_type::right_map::const_iterator::value_type const&, - beast::IP::Endpoint const&> + struct Transform +#ifdef _LIBCPP_VERSION + : std::unary_function< + map_type::right_map::const_iterator::value_type const&, + beast::IP::Endpoint const&> +#endif { +#ifndef _LIBCPP_VERSION + using first_argument_type = map_type::right_map::const_iterator::value_type const&; + using result_type = beast::IP::Endpoint const&; +#endif + explicit Transform() = default; beast::IP::Endpoint const& operator() ( diff --git a/src/ripple/peerfinder/impl/Livecache.h b/src/ripple/peerfinder/impl/Livecache.h index 2224543c6e..c325626793 100644 --- a/src/ripple/peerfinder/impl/Livecache.h +++ b/src/ripple/peerfinder/impl/Livecache.h @@ -71,8 +71,15 @@ public: public: // Iterator transformation to extract the endpoint from Element struct Transform - : public std::unary_function +#ifdef _LIBCPP_VERSION + : public std::unary_function +#endif { +#ifndef _LIBCPP_VERSION + using first_argument = Element; + using result_type = Endpoint; +#endif + explicit Transform() = default; Endpoint const& operator() (Element const& e) const @@ -227,9 +234,15 @@ public: template struct Transform - : public std::unary_function < - typename lists_type::value_type, Hop > +#ifdef _LIBCPP_VERSION + : public std::unary_function> +#endif { +#ifndef _LIBCPP_VERSION + using first_argument = typename lists_type::value_type; + using result_type = Hop ; +#endif + explicit Transform() = default; Hop operator() (typename beast::maybe_const < diff --git a/src/test/app/PayStrand_test.cpp b/src/test/app/PayStrand_test.cpp index 4c1e809081..8495f45433 100644 --- a/src/test/app/PayStrand_test.cpp +++ b/src/test/app/PayStrand_test.cpp @@ -897,7 +897,7 @@ struct PayStrand_test : public beast::unit_test::suite false, env.app().logs().journal("Flow")); BEAST_EXPECT(r.first == expTer); - if (sizeof...(expSteps)) + if (sizeof...(expSteps) !=0 ) BEAST_EXPECT(equal( r.second, std::forward(expSteps)...)); };