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 bug in dep resolution when requesting a "const T*" #579

Merged
merged 1 commit into from
May 23, 2023

Conversation

J-Meyers
Copy link
Contributor

Duplicate of #347

Hello,
I have fixed a bug in dependency resolution when requesting a "const T*" after injecting a "T*" as dependency.

Before this fix, if a T* was injected as dependency, requesting a const T* will result in a invalid nullptr.
The dependency resolution of objects passed by reference is not affected by this problem.

I have added four tests:

dependencies_with_reference
dependencies_with_const_reference
dependencies_with_pointer
dependencies_with_const_pointer (this test fails without the fix)
I am new to TMP and this is my first contribute in general so I hope I didn't do anything wrong.

I recently encountered this same issue, figured I'd resolve any merge conflicts so that it's able to be merged in.

…g a "T*"

Before this fix, if a T* was injected as depedency, requesting a const T* will result in a invalid nullptr.
Four unit tests added.

(cherry picked from commit 7ca4d03)
@kris-jusiak kris-jusiak merged commit ef0f2fd into boost-ext:master May 23, 2023
@J-Meyers J-Meyers deleted the const_T_ptr_dep_resolution branch May 23, 2023 16:49
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.

3 participants