]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix for wxString::Format("no variadic arguments") and VC6
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 13 Aug 2007 17:56:09 +0000 (17:56 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 13 Aug 2007 17:56:09 +0000 (17:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h

index 7345c36d17daf2103951111fc402c17ee7ccb547..813dc956aaac5144a5d8fa14fe06cc21e2936a82 100644 (file)
@@ -342,14 +342,16 @@ public:
     // We have to implement the version without template arguments manually
     // because of the StringReturnType<> hack, although WX_DEFINE_VARARG_FUNC
     // normally does it itself. It has to be a template so that we can use
-    // the hack, even though there's no real template parameter:
-    struct FormatDummyArg {} ;
-
+    // the hack, even though there's no real template parameter. We can't move
+    // it to wxStrig, because it would shadow these versions of Format() then.
     template<typename T>
     inline static typename StringReturnType<T>::type
-    Format(const wxFormatString& fmt, FormatDummyArg dummy = FormatDummyArg())
+    Format(const T& fmt)
     {
-        return DoFormatWchar(fmt);
+        // NB: this doesn't compile if T is not (some form of) a string;
+        //     this makes Format's prototype equivalent to
+        //     Format(const wxFormatString& fmt)
+        return DoFormatWchar(wxFormatString(fmt));
     }
 
     // int Printf(const wxString& format, ...);