Page MenuHomePhabricator

Merge #13656: Remove the boost/algorithm/string/predicate.hpp dependency
ClosedPublic

Authored by nakihito on Dec 13 2019, 22:37.

Details

Summary

e3245f2e7b Removes Boost predicate.hpp dependency (251)

Pull request description:

This pull request removes the `boost/algorithm/string/predicate.hpp` dependency from the project.

To replace the the `predicate.hpp` dependency from the project the function calls to `boost::algorithm::starts_with` and `boost::algorithm::ends_with` have been replaced with respectively C++11's `std::basic_string::front` and `std::basic_string::back` function calls.

Refactors that were not required, but have been done anyways:

- The Boost function `all` was implicitly made available via the `predicate.hpp` header. Instead of including the appropriate header, function calls to `all` have been replaced with function calls to `std::all_of`.

- The  `boost::algorithm::is_digit` predicate has been replaced with a custom `IsDigit` function that is locale independent and ASCII deterministic.

Tree-SHA512: 22dda6adfb4d7ac0cabac8cc33e8fb8330c899805acc1ae4ede402c4b11ea75a399414b389dfaa3650d23b47f41351b4650077af9005d598fbe48d5277bdc320

Backport of Core PR13656
https://github.com/bitcoin/bitcoin/pull/13656/

Test Plan
make check

Undo the change to the linter script

arc lint --everything

Should output:

Advice  (BOOST_DEPENDENCY) Good job! A boost dependency has been removed.
  Good job! The Boost dependency "boost/algorithm/string/predicate.hpp" is
  no longer used.
  Please remove it from EXPECTED_BOOST_INCLUDES in
  <path>/bitcoin-abc/test/lint/lint-boost-dependencies.sh
  to make sure this dependency is not accidentally reintroduced.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR13656
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8560
Build 15110: Default Diff Build & Tests
Build 15109: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Dec 13 2019, 22:37

The core_read.cpp code diveged from Core's in D1292. I've adjusted the backport to account for this.

The change to netbase.cpp was previously made in D1893.

src/torcontrol.cpp
15

This was not part of the original PR, but was a relevant change.

Always a fan of the deboosting. Too bad about the code ownership but it looks right.

This revision is now accepted and ready to land.Dec 14 2019, 04:07