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

Don't store non-owned dependencies as shared_ptr #1824

Open
godexsoft opened this issue Jan 13, 2025 · 0 comments
Open

Don't store non-owned dependencies as shared_ptr #1824

godexsoft opened this issue Jan 13, 2025 · 0 comments
Labels
enhancement New feature or request refactoring Code improvements without logical changes
Milestone

Comments

@godexsoft
Copy link
Collaborator

Summary

We have a lot of classes where we store dependencies that we don't own as a shared_ptr. This disturbs local reasoning and it's better to use a non-owning reference like std::reference_wrapper.

Solution

Use std::reference_wrapper instead for non-owned dependencies.

@godexsoft godexsoft added enhancement New feature or request refactoring Code improvements without logical changes labels Jan 13, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Clio Jan 13, 2025
@godexsoft godexsoft added this to the Future milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Code improvements without logical changes
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant