зеркало из https://github.com/mozilla/gecko-dev.git
bug 1220042 make AlignedTArray base class inheritance private r=jwwang
because base class methods will not be safe with different Elements() and Length() methods. --HG-- extra : rebase_source : 7616f0eb12e1d8098620682f6eb9b4c5f40f873f
This commit is contained in:
Родитель
8ef32fab59
Коммит
08b9621b96
|
@ -15,7 +15,7 @@
|
|||
* N: N bytes alignment for the first element, defaults to 32
|
||||
*/
|
||||
template <typename E, int N = 32>
|
||||
class AlignedTArray : public nsTArray_Impl<E, nsTArrayInfallibleAllocator>
|
||||
class AlignedTArray : private nsTArray_Impl<E, nsTArrayInfallibleAllocator>
|
||||
{
|
||||
static_assert((N & (N-1)) == 0, "N must be power of 2");
|
||||
typedef nsTArray_Impl<E, nsTArrayInfallibleAllocator> base_type;
|
||||
|
@ -46,6 +46,9 @@ public:
|
|||
return base_type::Length() <= sExtra ? 0 : base_type::Length() - sExtra;
|
||||
}
|
||||
|
||||
using base_type::ShallowSizeOfExcludingThis;
|
||||
using base_type::ShallowSizeOfIncludingThis;
|
||||
|
||||
private:
|
||||
AlignedTArray(const AlignedTArray& other) = delete;
|
||||
void operator=(const AlignedTArray& other) = delete;
|
||||
|
|
Загрузка…
Ссылка в новой задаче