removed the non-|const| version of |nsAutoCString::operator const char*| since the const version serves in both |const| and non-|const| situations, and will be ambiguous to many compilers.

This commit is contained in:
scc%netscape.com 1999-04-24 18:40:36 +00:00
parent 5b9b68d3fb
commit b7e35a36a2
2 changed files with 8 additions and 2 deletions

View File

@ -201,7 +201,10 @@ public:
NS_EXPLICIT nsAutoCString(const nsString& other) : mCString(other.ToNewCString()) {}
virtual ~nsAutoCString();
operator const char*() const { return mCString; }
operator const char*() { return mCString; }
// operator const char*() { return mCString; }
// don't need this, since |operator const char*() const| can
// serve for both |const| and non-|const| callers
protected:
const char* mCString;
}; // class nsAutoCString

View File

@ -201,7 +201,10 @@ public:
NS_EXPLICIT nsAutoCString(const nsString& other) : mCString(other.ToNewCString()) {}
virtual ~nsAutoCString();
operator const char*() const { return mCString; }
operator const char*() { return mCString; }
// operator const char*() { return mCString; }
// don't need this, since |operator const char*() const| can
// serve for both |const| and non-|const| callers
protected:
const char* mCString;
}; // class nsAutoCString