// accounts for string changes done by wxArgNormalizer<>
//
// Note that this class can _only_ be used for function arguments!
-#ifdef __VISUALC__
- // "struct 'wx[W]CharBuffer<T>' needs to have dll-interface to be used by
- // clients of class 'wxString'" - this is private, we don't care
- #pragma warning (disable:4251)
-#endif
class WXDLLIMPEXP_BASE wxFormatString
{
public:
private:
wxCharBuffer m_char;
wxWCharBuffer m_wchar;
-#ifdef __VISUALC__
- #pragma warning (default:4251)
-#endif
// NB: we can use a pointer here, because wxFormatString is only used
// as function argument, so it has shorter life than the string
template<>
struct wxFormatStringArgumentFinder<wxFormatString>
-{
- static wxFormatStringArgument find(const wxFormatString& arg)
- { return wxFormatStringArgument(&arg); }
-};
+ : public wxFormatStringArgumentFinder<const wxFormatString&> {};
+
+// avoid passing big objects by value to wxFormatStringArgumentFinder::find()
+// (and especially wx[W]CharBuffer with its auto_ptr<> style semantics!):
+template<>
+struct wxFormatStringArgumentFinder<wxString>
+ : public wxFormatStringArgumentFinder<const wxString&> {};
+
+template<>
+struct wxFormatStringArgumentFinder<wxCharBuffer>
+ : public wxFormatStringArgumentFinder<const wxCharBuffer&> {};
+
+template<>
+struct wxFormatStringArgumentFinder<wxWCharBuffer>
+ : public wxFormatStringArgumentFinder<const wxWCharBuffer&> {};
// ----------------------------------------------------------------------------