Allow wxAny to contain 'const char*' or 'const wchar_t*'. This was previously not possible since these pointers were converted to wxString, as convenient means to work with string literals. Now pointers (to string literals) are stored instead, and As<wxString>(), comparison operators do the type conversion.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2010-04-22 13:51:38 +00:00
parent a96160b58f
commit 153107b402
6 changed files with 173 additions and 67 deletions

View File

@@ -104,14 +104,17 @@ public:
~wxAny();
/**
This template function converts wxAny into given type. No dynamic
conversion is performed, so if the type is incorrect an assertion
failure will occur in debug builds, and a bogus value is returned
in release ones.
This template function converts wxAny into given type. In most cases
no type conversion is performed, so if the type is incorrect an
assertion failure will occur.
@remarks This template function may not work properly with Visual C++
6. For full compiler compatibility, please use
wxANY_AS(any, T) macro instead.
@remarks For conveniency, conversion is done when T is wxString. This
is useful when a string literal (which are treated as
const char* and const wchar_t*) has been assigned to wxAny.
This template function may not work properly with Visual C++
6. For full compiler compatibility, please use
wxANY_AS(any, T) macro instead.
*/
template<typename T>
T As() const;