C++ Logo

std-proposals

Advanced search

Re: [std-proposals] <type_traits> std::contains_mutable

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Mon, 17 Nov 2025 12:28:16 +0100
Il 14/11/25 15:38, Frederick Virchanza Gotham via Std-Proposals ha scritto:
> Looking over the recent papers on reflection . . . I think this would
> be done in reflection as follows:

To be honest, with reflection in the language, we should take a step
back and consider thinking about a policy here: will it still make sense
to add more type traits to the standard library? If yes, what should be
the bar for inclusion?

What I'm trying to say is that queries that required compiler assistance
(such as this one, "does this class have any `mutable` members?") are
now entirely implementable in user code. Therefore there should be some
justification as of why they should be added to the Standard Library.

(Incomplete list,
* query matches a language definition
* query is difficult to write correctly, users might mess it up
* query is common, would be better implemented as an intrinsic
* ...)

My 2 c,
--
Giuseppe D'Angelo

Received on 2025-11-17 11:28:21