From 5431a79f1e329263347e07109fa101fba7510a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 29 Jul 2008 23:10:04 +0000 Subject: [PATCH] optimize wxFormatStringArgumentFinder for strings and make it work correctly for wxCharBuffer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/strvararg.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index 4cbe39b3aa..b7a1a19d86 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -227,10 +227,21 @@ struct wxFormatStringArgumentFinder template<> struct wxFormatStringArgumentFinder -{ - static wxFormatStringArgument find(const wxFormatString& arg) - { return wxFormatStringArgument(&arg); } -}; + : public wxFormatStringArgumentFinder {}; + +// avoid passing big objects by value to wxFormatStringArgumentFinder::find() +// (and especially wx[W]CharBuffer with its auto_ptr<> style semantics!): +template<> +struct wxFormatStringArgumentFinder + : public wxFormatStringArgumentFinder {}; + +template<> +struct wxFormatStringArgumentFinder + : public wxFormatStringArgumentFinder {}; + +template<> +struct wxFormatStringArgumentFinder + : public wxFormatStringArgumentFinder {}; // ----------------------------------------------------------------------------