зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1466449 addendum - Turn jArray from a struct to class and make it have a constructor from nullptr. r=smaug.
Simple adding a constructor from nullptr did not compile without turning jArray all the way to a class instead of struct.
This commit is contained in:
Родитель
1aa4b36f30
Коммит
8c8503b03f
|
@ -48,9 +48,17 @@ struct staticJArray
|
|||
};
|
||||
|
||||
template<class T, class L>
|
||||
struct jArray
|
||||
class autoJArray;
|
||||
|
||||
template<class T, class L>
|
||||
class jArray
|
||||
{
|
||||
friend class autoJArray<T, L>;
|
||||
|
||||
private:
|
||||
T* arr;
|
||||
|
||||
public:
|
||||
L length;
|
||||
static jArray<T, L> newJArray(L const len)
|
||||
{
|
||||
|
@ -77,6 +85,23 @@ struct jArray
|
|||
arr = (T*)other.arr;
|
||||
length = other.length;
|
||||
}
|
||||
MOZ_IMPLICIT jArray(decltype(nullptr))
|
||||
: arr(nullptr)
|
||||
, length(0)
|
||||
{
|
||||
}
|
||||
jArray()
|
||||
: arr(nullptr)
|
||||
, length(0)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
jArray(T* aArr, L aLength)
|
||||
: arr(aArr)
|
||||
, length(aLength)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<class T, class L>
|
||||
|
|
Загрузка…
Ссылка в новой задаче