зеркало из https://github.com/mozilla/gecko-dev.git
Add operator->* to nsAutoPtr and nsRefPtr. (Bug 525205) Pending review, but fixes bustage for a bunch of people.
This commit is contained in:
Родитель
c53272b65f
Коммит
dc40ce0d34
|
@ -184,6 +184,19 @@ class nsAutoPtr
|
|||
return get();
|
||||
}
|
||||
|
||||
// This operator is needed for gcc <= 4.0.* and for Sun Studio; it
|
||||
// causes internal compiler errors for some MSVC versions. (It's not
|
||||
// clear to me whether it should be needed.)
|
||||
#ifndef _MSC_VER
|
||||
template <class U, class V>
|
||||
U&
|
||||
operator->*(U V::* aMember)
|
||||
{
|
||||
NS_PRECONDITION(mRawPtr != 0, "You can't dereference a NULL nsAutoPtr with operator->*().");
|
||||
return get()->*aMember;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
|
@ -1085,6 +1098,19 @@ class nsRefPtr
|
|||
return get();
|
||||
}
|
||||
|
||||
// This operator is needed for gcc <= 4.0.* and for Sun Studio; it
|
||||
// causes internal compiler errors for some MSVC versions. (It's not
|
||||
// clear to me whether it should be needed.)
|
||||
#ifndef _MSC_VER
|
||||
template <class U, class V>
|
||||
U&
|
||||
operator->*(U V::* aMember)
|
||||
{
|
||||
NS_PRECONDITION(mRawPtr != 0, "You can't dereference a NULL nsRefPtr with operator->*().");
|
||||
return get()->*aMember;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче