Skip to content
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

Better monadic operations for fastgltf::OptionalWithFlagValue<T> #70

Closed
n0F4x opened this issue Aug 19, 2024 · 0 comments
Closed

Better monadic operations for fastgltf::OptionalWithFlagValue<T> #70

n0F4x opened this issue Aug 19, 2024 · 0 comments
Labels
done Everything has been addressed enhancement New feature or request

Comments

@n0F4x
Copy link
Contributor

n0F4x commented Aug 19, 2024

The current implementation of the and_then and transform return OptionalWithFlagValue<T>.
These could be changed to return Optional<*type based on the parameter's return type*>.

Also, the const overloads of these functions are missing. They should be added as well.

n0F4x added a commit to n0F4x/fastgltf that referenced this issue Aug 19, 2024
- missing check that function provided for `and_then` returns an optional type
- improved function call with `std::invoke`

-also fixes test cases where `quat::value_ptr` wasn't renamed to `quat::data`
@spnda spnda added the enhancement New feature or request label Aug 19, 2024
spnda pushed a commit that referenced this issue Aug 20, 2024
The return type of `and_then` and `transform` is now a `Optional<T>`, since the return type is allowed to change and `OptionalWithFlagValue<T>` might not support that type. Those two functions now also have correct const overloads.
@spnda spnda closed this as completed Aug 21, 2024
@spnda spnda added the done Everything has been addressed label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Everything has been addressed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants