21 Aug
2021
21 Aug
'21
7:13 p.m.
P.S. I think gcc might have been reason why I misremembered how assert does
or does not work in constexpr, so maybe
that is the reason why it is commented out in clamp?
It was fixed few years ago(GCC 9).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86678
On Sat, Aug 21, 2021 at 9:05 PM Ivan Matek
On Sat, Aug 21, 2021 at 5:56 PM Peter Dimov via Boost < boost@lists.boost.org> wrote:
It does. https://www.godbolt.org/z/KhPja6cEs
Ah my mistake. :( Do you then maybe know why boost clamp has commented out the assert in implementation?
https://github.com/boostorg/algorithm/blob/c9077bd49580bddfaa8a5c71abc4022a2... I presumed it is to avoid problems with assert and constexpr, but as you now I learned assert works fine since C++14.