-
Notifications
You must be signed in to change notification settings - Fork 37.7k
remove usage of boost::bind #19844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove usage of boost::bind #19844
Conversation
boost::bind usage was removed in bitcoin#13743. However a new usage snuck in as part of 2bc4c3e (bitcoin#15225).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c4be50f, it seems a linter is required :)
ACK c4be50f -- diff looks correct
Linter requested. Linter delivered: new file mode 100755
index 000000000..99d60b58d
--- /dev/null
+++ b/test/lint/lint-cpp.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2018-2020 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#
+# Check for various C++ code patterns we want to avoid.
+
+export LC_ALL=C
+
+EXIT_CODE=0
+
+OUTPUT=$(git grep -E "boost::bind\(" -- "*.cpp" "*.h")
+if [[ ${OUTPUT} != "" ]]; then
+ echo "Use of boost::bind detected. Use std::bind instead."
+ echo
+ echo "${OUTPUT}"
+ EXIT_CODE=1
+fi
+
+exit ${EXIT_CODE} Always happy to lint! |
ACK |
ACK + linter. |
This currently only checks for boost::bind usage. Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
C++ linter added as requested. |
ACK e36f802 -- patch looks correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e36f802
Result of cherry-picking only the linter commit into the master branch:
$ test/lint/lint-cpp.sh
Use of boost::bind detected. Use std::bind instead.
src/qt/walletmodel.cpp: m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(boost::bind(NotifyCanGetAddressesChanged, this));
EXIT_CODE=1 | ||
fi | ||
|
||
exit ${EXIT_CODE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently only checks for boost::bind usage. Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
boost::bind
usage was removed in #13743. However a new usage snuck in aspart of 2bc4c3e (#15225).