diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-12 14:07:37 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-07-17 10:29:26 +0000 |
commit | ec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch) | |
tree | 25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/base/tuple.h | |
parent | bb09965444b5bb20b096a291445170876225268d (diff) | |
download | qtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz |
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/base/tuple.h')
-rw-r--r-- | chromium/base/tuple.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/chromium/base/tuple.h b/chromium/base/tuple.h index 34fd789976f..e13afaf31fc 100644 --- a/chromium/base/tuple.h +++ b/chromium/base/tuple.h @@ -51,20 +51,6 @@ template <size_t N, size_t... Ns> struct MakeIndexSequenceImpl<N, Ns...> : MakeIndexSequenceImpl<N - 1, N - 1, Ns...> {}; -// std::get() in <=libstdc++-4.6 returns an lvalue-reference for -// rvalue-reference of a tuple, where an rvalue-reference is expected. -template <size_t I, typename... Ts> -typename std::tuple_element<I, std::tuple<Ts...>>::type&& get( - std::tuple<Ts...>&& t) { - using ElemType = typename std::tuple_element<I, std::tuple<Ts...>>::type; - return std::forward<ElemType>(std::get<I>(t)); -} - -template <size_t I, typename T> -auto get(T& t) -> decltype(std::get<I>(t)) { - return std::get<I>(t); -} - template <size_t N> using MakeIndexSequence = typename MakeIndexSequenceImpl<N>::Type; @@ -88,7 +74,7 @@ inline void DispatchToMethodImpl(const ObjT& obj, Method method, Tuple&& args, IndexSequence<Ns...>) { - (obj->*method)(base::get<Ns>(std::forward<Tuple>(args))...); + (obj->*method)(std::get<Ns>(std::forward<Tuple>(args))...); } template <typename ObjT, typename Method, typename Tuple> @@ -105,7 +91,7 @@ template <typename Function, typename Tuple, size_t... Ns> inline void DispatchToFunctionImpl(Function function, Tuple&& args, IndexSequence<Ns...>) { - (*function)(base::get<Ns>(std::forward<Tuple>(args))...); + (*function)(std::get<Ns>(std::forward<Tuple>(args))...); } template <typename Function, typename Tuple> @@ -128,7 +114,7 @@ inline void DispatchToMethodImpl(const ObjT& obj, OutTuple* out, IndexSequence<InNs...>, IndexSequence<OutNs...>) { - (obj->*method)(base::get<InNs>(std::forward<InTuple>(in))..., + (obj->*method)(std::get<InNs>(std::forward<InTuple>(in))..., &std::get<OutNs>(*out)...); } |