declared private wxString::operator=(int) to prevent code like "str = 17;" from compiling

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-08-24 14:37:30 +00:00
parent bcd3d8d9e2
commit 00b4a13e0c

View File

@ -287,14 +287,20 @@ private:
void CopyBeforeWrite(); void CopyBeforeWrite();
void AllocBeforeWrite(size_t); void AllocBeforeWrite(size_t);
// this method is not implemented - there is _no_ conversion from int to // if we hadn't made these operators private, it would be possible to
// compile "wxString s; s = 17;" without any warnings as 17 is implicitly
// converted to char in C and we do have operator=(char)
//
// NB: we don't need other versions (short/long and unsigned) as attempt
// to assign another numeric type to wxString will now result in
// ambiguity between operator=(char) and operator=(int)
wxString& operator=(int);
// these methods are not implemented - there is _no_ conversion from int to
// string, you're doing something wrong if the compiler wants to call it! // string, you're doing something wrong if the compiler wants to call it!
// //
// try `s << i' or `s.Printf("%d", i)' instead // try `s << i' or `s.Printf("%d", i)' instead
wxString(int); wxString(int);
wxString(unsigned int);
wxString(long);
wxString(unsigned long);
public: public:
// constructors and destructor // constructors and destructor