mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +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
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