C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D4285R0 Floating-point traits

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Wed, 24 Jun 2026 19:02:29 +0200
On 6/24/26 09:23, Jan Schultke wrote:

[Jens:]
> P2551 Clarify intent of P1841 numeric traits
> https://github.com/cplusplus/papers/issues/1211 <https://github.com/cplusplus/papers/issues/1211>
>
>
> and
>
>
> P1841 Wording for Individually Specializable Numeric Traits
> https://github.com/cplusplus/papers/issues/594 <https://github.com/cplusplus/papers/issues/594>
>
>
> I think the general direction already got LEWG approval,
> but the paper is waiting for the paper author to apply
> the changes from P2551, as far as I can remember.
>
>
> Please discuss the next steps with the author of P1841.
>
>
> Yeah, thanks for providing that context. I've reached out to Walter, and I think you're right that LWG is just waiting for him to apply those wording changes since 2022.
>
> Unfortunately I don't think that what I'm trying to do and what prior papers try to do are really aligned. When trying to extract dozens (potentially over a hundred) floating-point-specific properties from a type, I'm not convinced that every single one of those properties should be a top-level, individually specializable trait.
>
> Things do become simpler if there is one std::float_traitstrait which only works for floats, rather than trying to individually answer for 100 traits what "exponent_bits_v<int>" means, among many, many, other questions.

Frankly,

   std::float_traits<T>::something

is just a syntactic transformation from

   std::something_v<T>

plus the statement "All traits in this subclause are disabled for non-floating-point types."

In any case, LEWG should know about the full picture, and you should add
references to those papers to your paper and explain why do don't wish
to purse an LEWG-approved design direction.

Jens

Received on 2026-06-24 17:02:32