Define element_type for consistency with other classes (wxSharedPtr, weak_ptr)
and to allow accessing the type from the template code.
Also remove the apparently unnecessary template assignment operator:
assignment from an expression convertible to type T* works even without it and
while assigning something implicitly convertible to T* wouldn't work now, it's
for the best as we don't want to rely on such implicit conversions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63933
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+ typedef T element_type;
+
// Default ctor
wxWeakRef() { }
// Default ctor
wxWeakRef() { }
- template <class TDerived>
- wxWeakRef<T>& operator=(TDerived* pobj)
- {
- this->Assign(pobj);
- return *this;
- }
-
wxWeakRef<T>& operator=(const wxWeakRef<T>& wr)
{
AssignCopy(wr);
wxWeakRef<T>& operator=(const wxWeakRef<T>& wr)
{
AssignCopy(wr);
class wxWeakRef<T> : public wxTrackerNode
{
public:
class wxWeakRef<T> : public wxTrackerNode
{
public:
+ /// Type of the element stored by this reference.
+ typedef T element_type;
+
/**
Constructor. The weak reference is initialized to @e pobj.
*/
/**
Constructor. The weak reference is initialized to @e pobj.
*/
/**
Called when the tracked object is destroyed. Be default sets
/**
Called when the tracked object is destroyed. Be default sets