C++ Logo

std-proposals

Advanced search

Re: Make non-specialized numeric_limits<T> use ill-formed

From: Lyberta <lyberta_at_[hidden]>
Date: Tue, 14 Apr 2020 20:39:19 +0300
Thiago Macieira via Std-Proposals:
> We wanted to add a specialisation of std::numeric_limits for qfloat16 as well
> as other cmath functions like inf(), fpclassify(), etc. Since doing that was
> UB, we had to add them with a q prefix (qInf, qFpClassify, etc.).
>
> In order to write generic code that deals with qfloat16, float and double, we
> needed to add the same overloads and specialisations for float and double.
>
> Conclusion: now Qt code has to use qFpClassify() instead of std::fpclassify().
>

This is because <cmath> is fundamentally broken because it doesn't use customization point objects. <cmath> needs a proper C++
replacement.


Received on 2020-04-14 12:42:23