1. Introduction
[P1494R4] "Partial program correctness"
introduced so-called observable checkpoints into the language,
as well as the function
to establish such a checkpoint in the program.
Three issues with the name
have been brought up ([Reflector], [Reddit]):
-
It doesn’t express intent very well, and a longer name could do that better.
-
Some associate it with the "observer" design pattern, but it is unrelated.
-
It is a short name, and using it for observable checkpoints now may impede future standardization.
1.1. How did it end up being called std :: observable
?
The name originated in P1494R0.
LEWG last discussed the name during its review of P1494R2 ([TeleconMinutes]).
Alternative names (including
) came up during that discussion,
but LEWG did not poll names.
The minutes of LEWG’s review of P1494R3 do not record a discussion of names.
Note: This does not mean to imply that LEWG neglected its duties. [P1494R4] itself does not discuss alternative names or request naming feedback.
EWG reviews did not poll names, and their minutes do not record a discussion of names. No further discussion of names occurred until the plenary vote at Hagenberg 2025.
Considering the situation, a name change should be polled before Sofia 2025. This needs to be done via paper or national body comment because [P1494R4] has already been approved in plenary.
2. Design
In discussions,
has emerged as a favorite suggestion.
It is a very good name because it is self-explanatory:
establishes an observable checkpoint.
std :: observable_checkpoint ()
This expresses intent as elegantly as
,
which documents that a point in the program is unreachable (or else ...).
on its own makes little sense
because it’s not trying to say that a point in the program is observable, or that it is observable behavior.
Instead,
is a checkpoint for prior observable behavior.
This intent should be expressed in the function name.
3. Proposed wording
The following changes are relative to [N5001] with the changes in [P1494R4] applied.
In subclause [cstdlib.syn], modify the synopsis as follows:
[[ noreturn ]] void quick_exit ( int status ) noexcept ; // freestanding void observable _checkpoint () noexcept ; // freestanding
In subclause [support.start.term],
modify the declaration of
as follows:
void observable _checkpoint () noexcept ; // freestanding Effects: Establishes an observable checkpoint ([intro.abstract]). No other effects.
4. Acknowledgements
Thanks to Mark Hoemmen for researching § 1.1 How did it end up being called std::observable?.