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

Turn resource adaptors into alias templates #1457

Open
Tracked by #1445
miscco opened this issue Feb 5, 2024 · 3 comments
Open
Tracked by #1445

Turn resource adaptors into alias templates #1457

miscco opened this issue Feb 5, 2024 · 3 comments
Assignees
Labels
cpp Pertains to C++ code feature request New feature or request

Comments

@miscco
Copy link
Contributor

miscco commented Feb 5, 2024

Currently all resource adaptors are templated on their upstream resource.

Transitioning to resource_ref this is superfluous, as we do not need to know the upstream type anymore.

However, we cannot simply remove the template argument, as that would break user code. So we need to first introduce an indirection using an alias:

template<class>
struct resource_adaptor_impl{};

template<class Upstream>
[[deprecated("Use resource_adaptor_ref instead")]] using resource_adaptor = resource_adaptor_impl<Upstream>;

using resource_adaptor_ref = resource_adaptor_impl<int>;
@harrism
Copy link
Member

harrism commented Feb 6, 2024

I'm confused by the ref here, because I don't think this is intended to be a reference. Am I correct? Is the idea to make the alias match the name we intend the caller to eventually use?

@miscco
Copy link
Contributor Author

miscco commented Feb 6, 2024

The issue is how to transition something that is a template to something that is not. I am all ears on how to switch names

@harrism
Copy link
Member

harrism commented Feb 6, 2024

I don't have any ideas but answers to my questions might give me some. :) I still have the same questions I wrote above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp Pertains to C++ code feature request New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants