Commit 74d1af87 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 3

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
parent 1d4854bc
...@@ -55,9 +55,14 @@ inline constexpr std::size_t sum(std::size_t v1, Args... vs) { ...@@ -55,9 +55,14 @@ inline constexpr std::size_t sum(std::size_t v1, Args... vs) {
return v1 + sum(vs...); return v1 + sum(vs...);
} }
template <class... Tuple> template <typename... Tuples>
using MakeIndexSequenceFromTuple = MakeIndexSequence<sum( struct TupleSizeSum {
std::tuple_size<typename std::decay<Tuple>::type>::value...)>; static constexpr auto value = sum(std::tuple_size<Tuples>::value...);
};
template <typename... Tuples>
using MakeIndexSequenceFromTuple = MakeIndexSequence<
TupleSizeSum<typename std::decay<Tuples>::type...>::value>;
// This is to allow using this with pointers to member functions, // This is to allow using this with pointers to member functions,
// where the first argument in the tuple will be the this pointer. // where the first argument in the tuple will be the this pointer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment