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

Make ConstantFunction autocast to arbitrary TIn #44

Open
AdamNorberg opened this issue Jul 6, 2021 · 0 comments
Open

Make ConstantFunction autocast to arbitrary TIn #44

AdamNorberg opened this issue Jul 6, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AdamNorberg
Copy link
Collaborator

ConstantFunction is a ContinuousMap that only ever returns one fixed value. It's innately indifferent to its TIn type.

Write a generic implicit cast to convert any ConstantFunction<TIn, TOut> to ConstantFunction<TIn2, TOut> for arbitrary TIn and TIn2 types, since the ConstantFunction doesn't use its input. The same function should be declared for a cast to ContinuousMap<TIn2, TOut>, since I'm not sure whether an upcast will implicitly combine with a user-defined conversion operator.

@AdamNorberg AdamNorberg added the enhancement New feature or request label Jul 6, 2021
@AdamNorberg AdamNorberg self-assigned this Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant