C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::arithmetic (concept)

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Sat, 12 Apr 2025 08:05:19 +0200
On 12/04/2025 07.41, Tymi via Std-Proposals wrote:
> Seems like that concept is missing, I would like to have it.

Plausible, near-real-world use-cases, please?
What can you meaningfully do with a type that is "arithmetic",
as opposed to one satisfying one of the more specialized
concepts?

> We already have std::integral anyway... And std::is_arithmetic...
>
> Possible implementation:
> ```cpp
> template <typename T>
> concept arithmetic = is_arithmetic_v<T>;
> ```

Should "integral" maybe subsume "arithmetic" for purposes
of partial ordering? That seems eminently plausible.
But your definition doesn't work for that.

> Yeah it would be zero WG21 work and little SG work I guess..

What's the basis for that "zero" guess?

Any library-related paper needs to pass through LEWG and LWG
and eventually plenary.

Jens

Received on 2025-04-12 06:05:22