mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
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:
parent
1aa4b36f30
commit
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>
|
||||
|
Loading…
Reference in New Issue
Block a user