mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
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).
This commit is contained in:
parent
17505ea5d9
commit
a08870cc19
Notes:
sideshowbarker
2024-07-18 07:35:20 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/a08870cc192 Pull-request: https://github.com/SerenityOS/serenity/pull/9127
1 changed files with 8 additions and 6 deletions
14
AK/Tuple.h
14
AK/Tuple.h
|
@ -59,15 +59,17 @@ private:
|
|||
|
||||
template<typename T, typename... TRest>
|
||||
struct Tuple<T, TRest...> : Tuple<TRest...> {
|
||||
Tuple(T&& first, TRest&&... rest)
|
||||
: Tuple<TRest...>(forward<TRest>(rest)...)
|
||||
, value(forward<T>(first))
|
||||
|
||||
template<typename FirstT, typename... RestT>
|
||||
Tuple(FirstT&& first, RestT&&... rest)
|
||||
: Tuple<TRest...>(forward<RestT>(rest)...)
|
||||
, value(forward<FirstT>(first))
|
||||
{
|
||||
}
|
||||
|
||||
Tuple(const T& first, const TRest&... rest)
|
||||
: Tuple<TRest...>(rest...)
|
||||
, value(first)
|
||||
Tuple(T&& first, TRest&&... rest)
|
||||
: Tuple<TRest...>(move(rest)...)
|
||||
, value(move(first))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue