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

Allow for move-only components. #208

Open
tylerreisinger opened this issue Apr 23, 2018 · 1 comment
Open

Allow for move-only components. #208

tylerreisinger opened this issue Apr 23, 2018 · 1 comment

Comments

@tylerreisinger
Copy link

Right now, trying to do e.assign<C>(...) for some C that has a deleted copy constructor will cause a substitution error when instantiating ComponentHelper::copy_component_to, even if that method is never called as the vtable still must be constructed. It would be nice to have proper support for move-only components as well.

A simple solution is to use SFINAE on ComponentHelper:

template <typename C>
+class ComponentHelper<C, std::enable_if_t<!std::is_copy_constructible_v<C>>>: public BaseComponentHelper { ... }

and to not actually copy in copy_component_to, but that delays any errors trying to copy until runtime. That is suboptimal, and there should be a much more elegant solution.

@lethal-guitar
Copy link
Contributor

lethal-guitar commented Apr 25, 2018

This would be nice. I can't verify at the moment, but I believe this used to work in an earlier version, the 1.2.0 release. Might be interesting to double check that it used to work, and then find the commit that changed it, maybe this gives some insight into how to bring it back while keeping improvements done in the meantime.

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

No branches or pull requests

2 participants