From 0001a080814ade48e5de2a8f80c2a8457e5ba092 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Thu, 9 Jul 2020 19:15:46 +0300 Subject: [PATCH 1/3] More perfect forwarding in field visitors --- src/Common/FieldVisitors.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Common/FieldVisitors.h b/src/Common/FieldVisitors.h index c45869c3746..f7b2bb0eb24 100644 --- a/src/Common/FieldVisitors.h +++ b/src/Common/FieldVisitors.h @@ -40,21 +40,24 @@ struct StaticVisitor template auto applyVisitor(Visitor && visitor, F && field) { - return Field::dispatch(visitor, field); + return Field::dispatch(std::forward(visitor), + std::forward(field)); } template auto applyVisitor(Visitor && visitor, F1 && field1, F2 && field2) { - return Field::dispatch([&](auto & field1_value) + return Field::dispatch( + [&field1, &field2, &visitor](auto & field1_value) { - return Field::dispatch([&](auto & field2_value) + return Field::dispatch( + [&field1_value, &visitor](auto & field2_value) { return visitor(field1_value, field2_value); }, - field2); + std::forward(field2)); }, - field1); + std::forward(field1)); } From 6479e2b40673724fefe98c0a084ea4d8b196fbbe Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Fri, 10 Jul 2020 08:37:43 +0300 Subject: [PATCH 2/3] Update FieldVisitors.h --- src/Common/FieldVisitors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/FieldVisitors.h b/src/Common/FieldVisitors.h index f7b2bb0eb24..d4b3b187ca4 100644 --- a/src/Common/FieldVisitors.h +++ b/src/Common/FieldVisitors.h @@ -48,7 +48,7 @@ template auto applyVisitor(Visitor && visitor, F1 && field1, F2 && field2) { return Field::dispatch( - [&field1, &field2, &visitor](auto & field1_value) + [&field2, &visitor](auto & field1_value) { return Field::dispatch( [&field1_value, &visitor](auto & field2_value) From c9478a8473d21f184f4cb7756150e33fdf302f3c Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Fri, 10 Jul 2020 18:42:50 +0300 Subject: [PATCH 3/3] restart the tests