From 8e7fef5f081dda8241f55b9cc75482e96ab251b8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 2 Nov 2017 23:34:38 +0100 Subject: [PATCH] Make wxStringOutputStream ctor explicit Avoid accidentally creating wxStringOutputStream from a wxString pointer, this seems unlikely, but why take the risk of it happening at all. --- include/wx/sstream.h | 4 ++-- interface/wx/sstream.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/sstream.h b/include/wx/sstream.h index f24419f8ad..47d17565a4 100644 --- a/include/wx/sstream.h +++ b/include/wx/sstream.h @@ -62,8 +62,8 @@ public: // // Note that the conversion object should have the life time greater than // this stream. - wxStringOutputStream(wxString *pString = NULL, - wxMBConv& conv = wxConvUTF8); + explicit wxStringOutputStream(wxString *pString = NULL, + wxMBConv& conv = wxConvUTF8); // get the string containing current output const wxString& GetString() const { return *m_str; } diff --git a/interface/wx/sstream.h b/interface/wx/sstream.h index a1250e5ff8..e9522db36e 100644 --- a/interface/wx/sstream.h +++ b/interface/wx/sstream.h @@ -62,7 +62,7 @@ public: with default value of this argument the data written to the stream must be valid UTF-8, pass @c wxConvISO8859_1 to deal with arbitrary 8 bit data. */ - wxStringOutputStream(wxString* pString = 0, wxMBConv& conv = wxConvUTF8); + explicit wxStringOutputStream(wxString* pString = NULL, wxMBConv& conv = wxConvUTF8); /** Returns the string containing all the data written to the stream so far.