util: Implement boolean conversion and !operator for uint* #13388

pull qmma70 wants to merge 5 commits into bitcoin:master from qmma70:uint_bool changing 4 files +50 −17
  1. qmma70 commented at 2:58 AM on June 4, 2018: contributor

    First time contributor

    1. Implement boolean conversion and operator!() for uint160/uint256 to be consistent with https://github.com/bitcoin/bitcoin/blob/master/src/arith_uint256.h#L67

    2. Implement boolean conversion operator for arith_uint256

    3. Add unit tests for (1) and (2)

  2. qmma70 renamed this:
    util: Implement boolean conversion and !operator for uint_*
    util: Implement boolean conversion and !operator for uint*
    on Jun 4, 2018
  3. add c++11 contor to class uint_error 42dfcf9d06
  4. implement boolean conversion for uint a12ea1e13e
  5. qmma70 force-pushed on Jun 4, 2018
  6. fix code formatting issue a9dadc31c6
  7. qmma70 force-pushed on Jun 4, 2018
  8. Empact commented at 9:18 AM on June 5, 2018: member

    Prefer removing this as per #13396.

  9. DrahtBot commented at 5:46 PM on June 5, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:

    • #13396 (Drop unused arith_uint256 ! operator by Empact)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  10. qmma70 commented at 11:20 PM on June 5, 2018: contributor

    The operators are good to haves IMO.

    But I'll close this one if #13396 is merged.

  11. skeees commented at 12:21 AM on June 6, 2018: contributor

    I'm a concept ACK on rationalizing the apis, note that there's code overlap with uint256::IsNull() so consider having one call the other

  12. call isNull() from operator bool 1137caef56
  13. fix lint; move test cases to the right place 4d8a172c5c
  14. laanwj commented at 5:14 AM on June 7, 2018: member

    I'm not sure it makes sense to add more unused methods. Also looks like this makes a lot of changes not directly related to the topic, please try to avoid that.

    I'm starting to prefer #13396 as well.

    To elaborate: At first removing the method seemed strange, but when I saw that the opposite method didn't exist either, my idea of API symmetry fell apart and removing the unused method seems better than doubling down on it and adding even more.

  15. laanwj commented at 5:21 PM on June 7, 2018: member

    Closing because #13396 merged

  16. laanwj closed this on Jun 7, 2018

  17. MarcoFalke locked this on Sep 8, 2021

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-22 09:15 UTC

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