Skip to content

Conversation

@Bonaducci
Copy link

Storage for non trivial type would still generate default copy/move constructors. Vector class would then generate default ones even in case explicitly defined constructors were not allowed via type traits. Default constructor is preferred over templated constructor. Deleting non trivial storage constructors prevents them from being generated for vector class and forcing compiler to pick available template constructors secured with type traits.
Also, move assignment operator should depend on move-constructability, otherwise it would not be instantiated for non-copyable types.

Storage for non trivial type would still generate default copy/move constructors. Vector class would then generate default ones even in case explicitly defined constructors were not allowed via type traits. Default constructor is preferred over templated constructor. Deleting non trivial storage constructors prevents them from being generated for vector class and forcing compiler to pick available template constructors secured with type traits.
Also, move assignment operator should depend on move-constructability, otherwise it would not be instantiated for non-copyable types.
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.

1 participant