From a08870cc192ebf32583df61090a87af65480a82c Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 31 Jul 2021 16:02:00 +0430 Subject: [PATCH] AK: Correct Tuple's constructor signatures Tuple previously required rvalue references, this commit makes it accept forwarding references instead (which was the intention all along). --- AK/Tuple.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/AK/Tuple.h b/AK/Tuple.h index 86793ab92e..9bdec66f15 100644 --- a/AK/Tuple.h +++ b/AK/Tuple.h @@ -59,15 +59,17 @@ private: template struct Tuple : Tuple { - Tuple(T&& first, TRest&&... rest) - : Tuple(forward(rest)...) - , value(forward(first)) + + template + Tuple(FirstT&& first, RestT&&... rest) + : Tuple(forward(rest)...) + , value(forward(first)) { } - Tuple(const T& first, const TRest&... rest) - : Tuple(rest...) - , value(first) + Tuple(T&& first, TRest&&... rest) + : Tuple(move(rest)...) + , value(move(first)) { }