Bug 1434710 - Replaced mozilla::IndexSequence with std::index_sequence in both xpcom/string/nsASCIIMask.h and xpcom/threads/nsThreadUtils.h and removed #include "mozilla/IndexSequence.h" from xpcom/string/nsASCIIMask.h. r=botond draft
authorTom Bannister <tomabann@gmail.com>
Wed, 04 Apr 2018 20:37:35 +1000
changeset 778306 0ff1c1e6a0e0a4594494d749ccd457e64d4ce68d
parent 778305 ba4e878caca9f632537e1202046cac561757c95b
child 778307 b629514a7b0bd8ba40e030f0a7261a34f1222ae5
push id105466
push userbmo:tomabann@gmail.com
push dateFri, 06 Apr 2018 06:41:20 +0000
reviewersbotond
bugs1434710
milestone61.0a1
Bug 1434710 - Replaced mozilla::IndexSequence with std::index_sequence in both xpcom/string/nsASCIIMask.h and xpcom/threads/nsThreadUtils.h and removed #include "mozilla/IndexSequence.h" from xpcom/string/nsASCIIMask.h. r=botond MozReview-Commit-ID: K7A9Yauf0gB
xpcom/string/nsASCIIMask.h
xpcom/threads/nsThreadUtils.h
--- a/xpcom/string/nsASCIIMask.h
+++ b/xpcom/string/nsASCIIMask.h
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsASCIIMask_h_
 #define nsASCIIMask_h_
 
 #include <array>
-#include "mozilla/IndexSequence.h"
 
 typedef std::array<bool, 128> ASCIIMaskArray;
 
 namespace mozilla {
 
 // Boolean arrays, fixed size and filled in at compile time, meant to
 // record something about each of the (standard) ASCII characters.
 // No extended ASCII for now, there has been no use case.
@@ -49,17 +48,17 @@ public:
 // constexpr std::array<bool, 128> sABCMask = CreateASCIIMask(TestABC);
 // ...
 // if (someChar < 128 && sABCMask[someChar]) this is A or B or C
 
 
 namespace details
 {
 template<typename F, size_t... Indices>
-constexpr std::array<bool, 128> CreateASCIIMask(F fun, mozilla::IndexSequence<Indices...>)
+constexpr std::array<bool, 128> CreateASCIIMask(F fun, std::index_sequence<Indices...>)
 {
   return {{ fun(Indices)... }};
 }
 } // namespace details
 
 template<typename F>
 constexpr std::array<bool, 128> CreateASCIIMask(F fun)
 {
--- a/xpcom/threads/nsThreadUtils.h
+++ b/xpcom/threads/nsThreadUtils.h
@@ -17,17 +17,16 @@
 #include "nsIRunnable.h"
 #include "nsIThreadManager.h"
 #include "nsITimer.h"
 #include "nsIThread.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "mozilla/Atomics.h"
-#include "mozilla/IndexSequence.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Move.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/TypeTraits.h"
 
 //-----------------------------------------------------------------------------
 // These methods are alternatives to the methods on nsIThreadManager, provided
@@ -1153,17 +1152,17 @@ struct RunnableMethodArguments final
 {
   Tuple<typename ::detail::ParameterStorage<Ts>::Type...> mArguments;
   template <typename... As>
   explicit RunnableMethodArguments(As&&... aArguments)
     : mArguments(Forward<As>(aArguments)...)
   {}
   template<typename C, typename M, typename... Args, size_t... Indices>
   static auto
-  applyImpl(C* o, M m, Tuple<Args...>& args, IndexSequence<Indices...>)
+  applyImpl(C* o, M m, Tuple<Args...>& args, std::index_sequence<Indices...>)
       -> decltype(((*o).*m)(Get<Indices>(args).PassAsParameter()...))
   {
     return ((*o).*m)(Get<Indices>(args).PassAsParameter()...);
   }
   template<class C, typename M> auto apply(C* o, M m)
       -> decltype(applyImpl(o, m, mArguments,
                   typename IndexSequenceFor<Ts...>::Type()))
   {