mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Add operator->* to nsAutoPtr and nsRefPtr. (Bug 525205) Pending review, but fixes bustage for a bunch of people.
This commit is contained in:
parent
c53272b65f
commit
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user