- expected[meta header]
- function[meta id-type]
- std[meta namespace]
- expected.void[meta class]
- cpp23[meta cpp]
// expected<cv void, E>部分特殊化
constexpr void operator*() const noexcept;正常値(void)を取得する。
has_value() == true
なし
投げない
#include <expected>
int main()
{
std::expected<void, int> x;
*x;
std::expected<void, int> y = std::unexpected{42};
//*y;
// エラー値を保持する y に対する operator* 呼び出しは未定義動作
}- *x[color ff0000]
- std::unexpected[link ../unexpected.md]
- C++23
- Clang: 16.0 [mark verified]
- GCC: 12.1 [mark verified]
- ICC: ??
- Visual C++: ??