Add non-template wxWeakRef<T> constructor from T*.

We need a non-template ctor to make the code initializing wxWeakRef with
literal NULL to compile.

Closes #11916.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-10 18:13:29 +00:00
parent fc4e23d7c1
commit 43aecc4dd7
2 changed files with 24 additions and 0 deletions

View File

@@ -211,6 +211,13 @@ public:
// Default ctor
wxWeakRef() { }
// Ctor from the object of this type: this is needed as the template ctor
// below is not used by at least g++4 when a literal NULL is used
wxWeakRef(T *pobj)
{
Assign(pobj);
}
// When we have the full type here, static_cast<> will always work
// (or give a straight compiler error).
template <class TDerived>