From 74d1af87831f9df2b5cb9d104db1d0e2edab591e Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Mon, 15 Aug 2016 15:56:35 -0700 Subject: [PATCH] Fix applyTuple to work under MSVC again Summary: Because MSVC didn't like the new version used to add support for multiple tuples. This also switches to std::index_sequence rather than our own home-grown version. Reviewed By: yfeldblum Differential Revision: D3706506 fbshipit-source-id: 724c995fe2671d21f78cd7ffa4b19ea1b278c308 --- folly/ApplyTuple.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/folly/ApplyTuple.h b/folly/ApplyTuple.h index 0288f567..b2298776 100644 --- a/folly/ApplyTuple.h +++ b/folly/ApplyTuple.h @@ -55,9 +55,14 @@ inline constexpr std::size_t sum(std::size_t v1, Args... vs) { return v1 + sum(vs...); } -template -using MakeIndexSequenceFromTuple = MakeIndexSequence::type>::value...)>; +template +struct TupleSizeSum { + static constexpr auto value = sum(std::tuple_size::value...); +}; + +template +using MakeIndexSequenceFromTuple = MakeIndexSequence< + TupleSizeSum::type...>::value>; // This is to allow using this with pointers to member functions, // where the first argument in the tuple will be the this pointer. -- 2.34.1