mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-29 02:17:09 +08:00
etl::variant was copy-constructible and copy-assignable even when an alternative was not copyable, and copying a non-copyable active alternative silently copied only the index, leaving the variant in an invalid state. Move the copy/move construct and assign logic into variant_base and add a variant_copy_move_control mixin that conditionally deletes the copy and move special members based on whether every alternative is copy/move constructible. The variant's special members are now defaulted, so they are deleted unless all alternatives support the operation. Fixes: #1512 Further, same-type-assignment optimization: Previously, assignment was destroy-and-reconstruct. Now, copy/move-assign are enabled if the types allow for it. Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| etl | ||