bsl icon indicating copy to clipboard operation
bsl copied to clipboard

Example test in readme.md doesn't really test addition

Open Kristine1975 opened this issue 2 years ago • 0 comments

The example code in README.md aims to test the += operator of safe_umx, but because it adds 42 to 0, it would also pass if the operator was (incorrectly) implemented as an assignment instead of an addition (as zero is the identity element of addition).

The fix would be to initialize data2 to a non-zero value.

https://github.com/Bareflank/bsl/blob/6509cfff948fa34b98585512d7be33a36e2f9522/README.md?plain=1#L139-L144

Kristine1975 avatar Feb 18 '22 08:02 Kristine1975