optional<T> 进入 C++ 标准的含义

Implications of optional<T> entering the C++ standard

std::optional<T> 构造最近 (?) 被 C++17 语言标准采用。现在,现有的 API 中有相当多的地方 std::optional<T> 是替代 return 类型函数的候选;本质上,这些函数试图 retrieve/produce 某些东西,但不能保证成功:

所以,我的问题是:标准委员会是否正在考虑(甚至已经接受)changes/additions 建立涉及使用 std::optional 的 API?如果是,标准的哪些部分(据您所知)可能会发生变化? C++17 或更高版本是否会发生此类更改?

Is the standard committee considering (or even has it accepted) changes/additions to established APIs that involve the use of std::optional?

委员会是否不太可能更改任何当前标准库对诸如 std::pair 之类的东西的使用,直到它被删除。如果他们在这方面 "keen",他们会应用类似于改变 std::tuple 而非 std::pair 的使用的东西。

像这样的更改会破坏 API,委员会 "known" 对此表示反对,除非(破坏向后兼容性)他们相对确定破坏是最小的,并且更改的优势大于破坏会发生。我认为 auto 是这种方法的合理示例。

If it is what parts of the standard (to your knowledge) are likely to change? And are such changes expected for C++17 or later?

希望新添加的库使用新添加的库。所以,基本上,期望 new 类 使用 std::optional(根据需要)。