Skip to content

Commit 31e6bbb

Browse files
allow using __optional with -fno-exceptions
1 parent f36b40a commit 31e6bbb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

include/stdexec/__detail/__optional.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,21 @@ namespace stdexec {
119119

120120
auto value() & -> _Tp& {
121121
if (!__has_value_) {
122-
throw __bad_optional_access();
122+
STDEXEC_THROW(__bad_optional_access());
123123
}
124124
return __value_;
125125
}
126126

127127
auto value() const & -> const _Tp& {
128128
if (!__has_value_) {
129-
throw __bad_optional_access();
129+
STDEXEC_THROW(__bad_optional_access());
130130
}
131131
return __value_;
132132
}
133133

134134
auto value() && -> _Tp&& {
135135
if (!__has_value_) {
136-
throw __bad_optional_access();
136+
STDEXEC_THROW(__bad_optional_access());
137137
}
138138
return static_cast<_Tp&&>(__value_);
139139
}

0 commit comments

Comments
 (0)