From c0513349d005443348ab685053d8560ef78d3a51 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Tue, 20 Oct 2015 10:16:20 +1100 Subject: [PATCH] Bug 1216040 - Make ArrayLength support mozilla::EnumeratedArray. r=froydnj --- mfbt/ArrayUtils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mfbt/ArrayUtils.h b/mfbt/ArrayUtils.h index 9566a3f40a8..b572272dd1c 100644 --- a/mfbt/ArrayUtils.h +++ b/mfbt/ArrayUtils.h @@ -20,6 +20,7 @@ #include "mozilla/Alignment.h" #include "mozilla/Array.h" +#include "mozilla/EnumeratedArray.h" #include "mozilla/TypeTraits.h" namespace mozilla { @@ -64,6 +65,13 @@ ArrayLength(const Array& aArr) return N; } +template +MOZ_CONSTEXPR size_t +ArrayLength(const EnumeratedArray& aArr) +{ + return size_t(N); +} + /* * Compute the address one past the last element of a constant-length array. *