mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1216040 - Make ArrayLength support mozilla::EnumeratedArray. r=froydnj
This commit is contained in:
parent
4fa140ec32
commit
8df7b927c3
@ -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<T, N>& aArr)
|
||||
return N;
|
||||
}
|
||||
|
||||
template<typename E, E N, typename T>
|
||||
MOZ_CONSTEXPR size_t
|
||||
ArrayLength(const EnumeratedArray<E, N, T>& aArr)
|
||||
{
|
||||
return size_t(N);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the address one past the last element of a constant-length array.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user