-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support JUST(may_expr, error_msg) #5855
Comments
I think we should simplify the JUST(foo<X, Y>(), error_msg<Z, W>()) Then we just cannot distinguish these two argument via |
A simple workaround: we give only a JUST(foo<X, Y>()) // error
JUST((foo<X, Y>())) // ok |
TRY(Foo<X, Y>()) // error
TRY((Foo<X, Y>())) // ok
const auto& maybe_val = TRY((Foo<X, Y>()), ErrorMsg<Z, W>()) // ok
JUST(maybe_val); // ok
JUST(TRY((Foo<X, Y>()), ErrorMsg<Z, W>())) |
The current #define TRY(...) __MaybeErrorStackCheckWrapper__(__VA_ARGS__) I think we can remake #define JUST_WITH_ERROR_MSG(val, msg) <`JUST(val)` with a error message `msg`> // or JUST_WITH_ERROR_MSG(val, ...)
JUST(foo<x, y>()) //ok
JUST_WITH_ERROR_MSG(foo<x, y>(), msg) // error!
JUST_WITH_ERROR_MSG((foo<x, y>()), msg) // ok |
BTW, I think |
|
motivation:
possible usages:
The text was updated successfully, but these errors were encountered: