C++ Logo

std-proposals

Advanced search

[std-proposals] Constexpr parameters

From: Григорий Шуренков <grigorij1981_at_[hidden]>
Date: Fri, 29 Aug 2025 15:02:24 +0300
Hello!

The idea of constexpr parameters is floated from time to time, but I don't
remember any proposals related to them.
The constexpr parameter is a parameter to a function that acts as a
constexpr variable (including the possibility to use it as a template
argument).
The value of constexpr parameter may influence the return type of the
function.

Is anybody working on any such proposal now?

I also remember someone saying that constexpr parameters are incredibly
hard to fit into current C++.
However, if we agree that a function with constexpr parameters should be an
(implicit) template
(which is hard to swallow, but I don't see any other option...), is it
really that difficult?

Regards,
Gregory

Received on 2025-08-29 12:02:37