Bug 1434710 - Replaced mozilla::IndexSequence with std::index_sequence and removed #include "mozilla/IndexSequence.h" from media/mtransport/runnable_utils.h. r=botond
MozReview-Commit-ID: Irb9PBPJRoF
--- a/media/mtransport/runnable_utils.h
+++ b/media/mtransport/runnable_utils.h
@@ -5,17 +5,16 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// Original author: ekr@rtfm.com
#ifndef runnable_utils_h__
#define runnable_utils_h__
#include "nsThreadUtils.h"
-#include "mozilla/IndexSequence.h"
#include "mozilla/Move.h"
#include "mozilla/RefPtr.h"
#include "mozilla/Tuple.h"
// Abstract base class for all of our templates
namespace mozilla {
namespace detail {
@@ -39,53 +38,53 @@ class runnable_args_base : public Runnab
NS_IMETHOD Run() override = 0;
};
template<typename R>
struct RunnableFunctionCallHelper
{
template<typename FunType, typename... Args, size_t... Indices>
- static R apply(FunType func, Tuple<Args...>& args, IndexSequence<Indices...>)
+ static R apply(FunType func, Tuple<Args...>& args, std::index_sequence<Indices...>)
{
return func(Get<Indices>(args)...);
}
};
// A void specialization is needed in the case where the template instantiator
// knows we don't want to return a value, but we don't know whether the called
// function returns void or something else.
template<>
struct RunnableFunctionCallHelper<void>
{
template<typename FunType, typename... Args, size_t... Indices>
- static void apply(FunType func, Tuple<Args...>& args, IndexSequence<Indices...>)
+ static void apply(FunType func, Tuple<Args...>& args, std::index_sequence<Indices...>)
{
func(Get<Indices>(args)...);
}
};
template<typename R>
struct RunnableMethodCallHelper
{
template<typename Class, typename M, typename... Args, size_t... Indices>
- static R apply(Class obj, M method, Tuple<Args...>& args, IndexSequence<Indices...>)
+ static R apply(Class obj, M method, Tuple<Args...>& args, std::index_sequence<Indices...>)
{
return ((*obj).*method)(Get<Indices>(args)...);
}
};
// A void specialization is needed in the case where the template instantiator
// knows we don't want to return a value, but we don't know whether the called
// method returns void or something else.
template<>
struct RunnableMethodCallHelper<void>
{
template<typename Class, typename M, typename... Args, size_t... Indices>
- static void apply(Class obj, M method, Tuple<Args...>& args, IndexSequence<Indices...>)
+ static void apply(Class obj, M method, Tuple<Args...>& args, std::index_sequence<Indices...>)
{
((*obj).*method)(Get<Indices>(args)...);
}
};
}
template<typename FunType, typename... Args>