[flang] make the ctor use special type deduction so members can be moved and

copied in the same call

Original-commit: flang-compiler/f18@d18e8391fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/393
This commit is contained in:
Eric Schweitz 2019-04-09 11:03:33 -07:00
parent 2f64d464d5
commit 253f361152
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ template<typename... Ts> struct SumTypeCopyMixin {
template<typename... Ts> struct ProductTypeMixin {
using ProductTypeTrait = std::true_type;
ProductTypeMixin(const Ts &... x) : t{x...} {}
ProductTypeMixin(Ts &&... x) : t{std::forward<Ts>(x)...} {}
template<typename... As>
ProductTypeMixin(As &&... x) : t{std::forward<As>(x)...} {}
ProductTypeMixin(ProductTypeMixin &&) = default;
ProductTypeMixin &operator=(ProductTypeMixin &&) = default;
ProductTypeMixin(const ProductTypeMixin &) = delete;