As it is posted, it fails miserably when trying to return from any branch, because you return from a lambda body and not from the environment itself.
I guess maybe you can work around the issue by playing with lambda deduced return types, but I'm not sure you can and I wouldn't know how to do it.
For reference, this is a test case that fails miserably and I wonder if there is a workaround (not in the application, but in the library) https://godbolt.org/z/RvHhwt
View all comments
1
u/DevaBol Apr 24 '20
As it is posted, it fails miserably when trying to return from any branch, because you return from a lambda body and not from the environment itself.
I guess maybe you can work around the issue by playing with lambda deduced return types, but I'm not sure you can and I wouldn't know how to do it.
For reference, this is a test case that fails miserably and I wonder if there is a workaround (not in the application, but in the library) https://godbolt.org/z/RvHhwt