P3641R0
Rename std::observable to std::observable_checkpoint

Published Proposal,

This version:
https://eisenwave.github.io/cpp-proposals/observable-checkpoint.html
Author:
Audience:
LEWG
Project:
ISO/IEC 14882 Programming Languages — C++, ISO/IEC JTC1/SC22/WG21
Source:
eisenwave/cpp-proposals

Abstract

Rename std::observable to std::observable_checkpoint.

1. Introduction

[P1494R4] "Partial program correctness" introduced so-called observable checkpoints into the language, as well as the function std::observable to establish such a checkpoint in the program.

Three issues with the name std::observable have been brought up ([Reflector], [Reddit]):

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 std::observable_checkpoint) 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, std::observable_checkpoint has emerged as a favorite suggestion. It is a very good name because it is self-explanatory:

std::observable_checkpoint() establishes an observable checkpoint.

This expresses intent as elegantly as std::unreachable, which documents that a point in the program is unreachable (or else ...).

std::observable 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, std::observable 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 std::observable() 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?.

References

Normative References

[N5001]
Thomas Köppe. Working Draft, Programming Languages — C++. 17 December 2024. URL: https://wg21.link/n5001
[P1494R4]
S. Davis Herring. Partial program correctness. 15 October 2024. URL: https://wg21.link/p1494r4

Informative References

[Reddit]
Redditors. WTF std::observable is?. URL: https://www.reddit.com/r/cpp/comments/1is7aqy/wtf_stdobservable_is/
[Reflector]
WG21. std::observable should have a better - ie worse - name. URL: https://lists.isocpp.org/lib-ext/2025/02/29541.php
[TeleconMinutes]
LEWG. LEWG Telecon Minutes for P1494R2. 1 February 2022. URL: https://wiki.edg.com/bin/view/Wg21telecons2022/P1494