Hi C++ enthusiasts,
This is my first message to std proposals.
I wanted to share a few different ideas expressed as 1liners I could work further, in order to find reasons for pursuing them (or not) as formal proposals. These ideas are (succinct):
- Code verbosity reduction. Ampliate the language allowing custom defaults for const/mut and noexcept/except (include new keywords to express opposite specifiers).
What does "custom defaults" mean?
Presumably something along the lines of `namespace noexcept { /* everything in this namespace is implicitly noexcept even though I didn't write the keyword */ }`.
We've had proposals in that general area before; notably 2021's
P2350 "constexpr class", which proposed a special syntax for "everything in this
class is implicitly
constexpr even though I didn't write the keyword." See particularly §6 of P2350, "What about other keywords?" P2350 was deemed "no consensus," which I think was good for C++, as "constexpr class" would not be a good feature.
And arguably "Profiles" (particularly 2019's
P1179, which proposed (page 14) that within the "Lifetime Safety Profile" the expressions p+x, x+p, p[x], p+=x, ... should be "errors," i.e., formalizing syntactic stretches of "dialect" C++ in which certain things are outlawed and/or certain expressions mean different things than within "vanilla" C++.
–Arthur