C++ Logo

sg16

Advanced search

Support for volatile char* in static_assert messages by P2741R1 ("user-generated static_assert messages")

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Sun, 5 Feb 2023 13:22:15 +0100
Hi,

The paper

https://isocpp.org/files/papers/P2741R1.pdf

suggests the following grammar extension

static_assert (constant-expression , constant-expression ) ;

and goes on to constrain it as follows:

"If a second constant-expression Msg is provided:
[..]
- Msg.data() shall be a well-formed constant expression whose type is
cv char* or cv char8_t*, and
[..]"

I have a hard time to understand the motivation for possibly volatile
qualified sequences of char or char8_t in static_assert messages. The
paper does never mention the word volatile as part of its motivation.

I would like to ask whether this wording suggestion in regard to
volatile support is meant seriously and what the use cases are for
volatile* char or even const volatile char* messages?

Thanks,

- Daniel

Received on 2023-02-05 12:22:26