You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this would be better since that is the entire point of std::optional.
I don't see the point of throwing an exception with std::optional.
It makes sense to throw an exception if , say, we have:
int i;
try {
db << "SELECT..." >> i{};
}
catch (errors::no_rows& e) {...}
but with std::optional it'd be better to do this:
std::optional<int> i{};
db << "SELECT..." >> i;
if (not i) {...}
The text was updated successfully, but these errors were encountered:
I think this would be better since that is the entire point of
std::optional
.I don't see the point of throwing an exception with
std::optional
.It makes sense to throw an exception if , say, we have:
but with
std::optional
it'd be better to do this:The text was updated successfully, but these errors were encountered: