Skip to content

Commit 9876ab8

Browse files
committed
Merge #19844: remove usage of boost::bind
e36f802 lint: add C++ code linter (fanquake) c4be50f remove usage of boost::bind (fanquake) Pull request description: `boost::bind` usage was removed in #13743. However a new usage snuck in as part of 2bc4c3e (#15225). ACKs for top commit: hebasto: ACK e36f802 practicalswift: ACK e36f802 -- patch looks correct Tree-SHA512: 2b0387c5443c184bcbf7df4849db1ed1296ff82c7b4ff0aff18334a400e56a472a972d18234d3866531a088d7a8da64688e58dc9f15daaad4048697c759d55ce
2 parents 2d4574a + e36f802 commit 9876ab8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/qt/walletmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void WalletModel::subscribeToCoreSignals()
413413
m_handler_transaction_changed = m_wallet->handleTransactionChanged(std::bind(NotifyTransactionChanged, this, std::placeholders::_1, std::placeholders::_2));
414414
m_handler_show_progress = m_wallet->handleShowProgress(std::bind(ShowProgress, this, std::placeholders::_1, std::placeholders::_2));
415415
m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged(std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1));
416-
m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(boost::bind(NotifyCanGetAddressesChanged, this));
416+
m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(std::bind(NotifyCanGetAddressesChanged, this));
417417
}
418418

419419
void WalletModel::unsubscribeFromCoreSignals()

test/lint/lint-cpp.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Check for various C++ code patterns we want to avoid.
8+
9+
export LC_ALL=C
10+
11+
EXIT_CODE=0
12+
13+
OUTPUT=$(git grep -E "boost::bind\(" -- "*.cpp" "*.h")
14+
if [[ ${OUTPUT} != "" ]]; then
15+
echo "Use of boost::bind detected. Use std::bind instead."
16+
echo
17+
echo "${OUTPUT}"
18+
EXIT_CODE=1
19+
fi
20+
21+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)