Skip to content

Commit

Permalink
Do not throw when there is not enough arg for optional
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Apr 12, 2024
1 parent 273d2d6 commit e6aa218
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/callback_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ template<typename T>
struct ArgConverter<std::optional<T>> {
static inline std::optional<std::optional<T>> GetNext(
Arguments* args, int flags, bool is_first) {
std::optional<T> out = ArgConverter<T>::GetNext(args, flags, is_first);
if (out)
return out;
else
return std::nullopt;
return ArgConverter<T>::GetNext(args, flags, is_first);
}
};

Expand Down

0 comments on commit e6aa218

Please sign in to comment.