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

Fix issue resolving const dependencies #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanHiggs
Copy link

Ran into an issue trying to resolve a std::shared_ptr<const ...> as an autowired dependency. I don't know whether this was intentional or not, but I believe resolving const dependencies is a legitimate usecase

The issue was that the existing ArgumentResolver specialization would try specialize where TArg included the const and this could not cast to std::shared_ptr<void> without loss of const qualification

To fix I have added an overload of ArgumentResolver that specializes for const types; it resolves the non-const type and converts to const after that. There are two test cases that fail without the new specialization and pass with it

Let me know if there are any changes you would need to accept this PR

Thanks

@shoheikuni shoheikuni mentioned this pull request Jun 11, 2023
@shoheikuni
Copy link

Hi. I wanted to deal with the same issue and pushed another solution to #55.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants