mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1216040 - Make ArrayLength support mozilla::EnumeratedArray. r=froydnj
This commit is contained in:
parent
0046a1f79e
commit
c0513349d0
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "mozilla/Alignment.h"
|
#include "mozilla/Alignment.h"
|
||||||
#include "mozilla/Array.h"
|
#include "mozilla/Array.h"
|
||||||
|
#include "mozilla/EnumeratedArray.h"
|
||||||
#include "mozilla/TypeTraits.h"
|
#include "mozilla/TypeTraits.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@ -64,6 +65,13 @@ ArrayLength(const Array<T, N>& aArr)
|
|||||||
return N;
|
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.
|
* Compute the address one past the last element of a constant-length array.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user