-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
force_opt combined with bind_opt results in compilation error #215
Comments
Ping @Siapran |
Whatever you chose @Siapran sounds good, I trust you on this and would very much appreciate a PR if you have the time! |
I'll try to do that today if whatever I caught on the flight back home will let me 👍 |
... I really should just rewrite the whole thing sooner than later. there's some really dubious (if not straight up wrong) moves going on in there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating a lens with force_opt as the innermost operation and then lifting this lens using bind_opt causes a compilation error. For example, adding the following code in test/type_erased_lens.cpp will not compile:
Error message from GCC 11.4.0
By turning the force_opt lens into a type-erased lens, the code will compile, so there should be nothing wrong with the logic of the code. This can be used as a workaround.
It is possible to get the same result with map_opt. However, in some cases it’s better for code organisation that these steps are in separate functions, which can be combined more freely.
The text was updated successfully, but these errors were encountered: