remove usage of boost::bind #19844

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:sneak_boost_bind changing 2 files +22 −1
  1. fanquake commented at 11:46 AM on August 31, 2020: member

    boost::bind usage was removed in #13743. However a new usage snuck in as part of 2bc4c3eaf96f5f8490fc79280422916c5d14cde3 (#15225).

  2. remove usage of boost::bind
    boost::bind usage was removed in #13743. However a new usage snuck in as
    part of 2bc4c3eaf96f5f8490fc79280422916c5d14cde3 (#15225).
    c4be50fea3
  3. hebasto approved
  4. hebasto commented at 11:55 AM on August 31, 2020: member

    ACK c4be50fea31e85f0e7151ed5ecaba531f6f929db, it seems a linter is required :)

  5. DrahtBot added the label GUI on Aug 31, 2020
  6. practicalswift commented at 12:37 PM on August 31, 2020: contributor

    ACK c4be50fea31e85f0e7151ed5ecaba531f6f929db -- diff looks correct @hebasto

    ACK c4be50f, it seems a linter required :)

    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!

  7. laanwj commented at 1:48 PM on August 31, 2020: member

    ACK Thanks @practicalswift — I think we do need a linter here, my first idea was to forbid the header that introduces boost::bind instead, however it seems it's included indirectly through almost anything boost …

  8. MarcoFalke added the label Refactoring on Aug 31, 2020
  9. promag commented at 2:42 PM on August 31, 2020: member

    ACK + linter.

  10. lint: add C++ code linter
    This currently only checks for boost::bind usage.
    
    Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
    e36f802fa4
  11. fanquake commented at 6:30 AM on September 1, 2020: member

    C++ linter added as requested.

  12. in test/lint/lint-cpp.sh:21 in e36f802fa4
      16 | +    echo
      17 | +    echo "${OUTPUT}"
      18 | +    EXIT_CODE=1
      19 | +fi
      20 | +
      21 | +exit ${EXIT_CODE}
    


    hebasto commented at 7:45 AM on September 1, 2020:

    nanonit: Screenshot from 2020-09-01 10-41-43

  13. practicalswift commented at 7:46 AM on September 1, 2020: contributor

    ACK e36f802fa4916586b53a989c0848389ad838b846 -- patch looks correct

  14. hebasto approved
  15. hebasto commented at 7:46 AM on September 1, 2020: member

    ACK e36f802fa4916586b53a989c0848389ad838b846

    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));
    
  16. fanquake merged this on Sep 3, 2020
  17. fanquake closed this on Sep 3, 2020

  18. fanquake deleted the branch on Sep 3, 2020
  19. PastaPastaPasta referenced this in commit b10159648f on Aug 21, 2021
  20. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me