Skip to content

Allow for move-only components. #208

@tylerreisinger

Description

@tylerreisinger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions