These are chat archives for boostorg/hana

14th
Dec 2015
Jason Rice
@ricejasonf
Dec 14 2015 18:02
Is static_cast<bool> preferred over using hana::not_ for performance reasons?
Louis Dionne
@ldionne
Dec 14 2015 18:03
Where?
Jason Rice
@ricejasonf
Dec 14 2015 18:04
boostorg/hana@95c8d6a
I was able to fix count_if, but I was just exploring different solutions
Louis Dionne
@ldionne
Dec 14 2015 18:12
I used static_cast<bool> because it matches precisely what the documentations says; the predicate needs to return an IntegralConstant that can be converted to bool. It also avoids having to include hana/not.hpp, but that’s merely a nice side-effect.
Jason Rice
@ricejasonf
Dec 14 2015 18:13
ok
Louis Dionne
@ldionne
Dec 14 2015 18:14
If you want, you can open a PR with the test code, and then we’ll see how this can be fixed. By opening a PR with the test code, the CI will tell us exactly the algorithms that are broken by this bug.
Jason Rice
@ricejasonf
Dec 14 2015 19:33
$ ./test/test.bugs.github_221 
((0), (0, 1, 1, 2))
came in handy :D
Louis Dionne
@ldionne
Dec 14 2015 19:35
cool!