]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed VC6 compilation - wxAny(const wxVariant&) ctor required a specific 'template<>')
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 17 Apr 2010 08:59:13 +0000 (08:59 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 17 Apr 2010 08:59:13 +0000 (08:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/any.h
src/common/variant.cpp

index e20ab0e78df35700c2066279cb511da3f2825615..91b1abf0f94f213beb524448969727da08ca9607 100644 (file)
@@ -679,11 +679,19 @@ public:
     /**
         Various constructors.
     */
+    template<typename T>
+    wxAny(const T& value)
+    {
+        m_type = wxAnyValueTypeImpl<T>::sm_instance;
+        wxAnyValueTypeImpl<T>::SetValue(value, m_buffer);
+    }
+
     wxAny(const char* value)
     {
         m_type = wxAnyNullValueType;
         Assign(wxString(value));
     }
+
     wxAny(const wchar_t* value)
     {
         m_type = wxAnyNullValueType;
@@ -697,6 +705,7 @@ public:
     }
 
 #if wxUSE_VARIANT
+    template<>
     wxAny(const wxVariant& variant)
     {
         m_type = wxAnyNullValueType;
@@ -704,12 +713,6 @@ public:
     }
 #endif
 
-    template<typename T>
-    wxAny(const T& value)
-    {
-        m_type = wxAnyValueTypeImpl<T>::sm_instance;
-        wxAnyValueTypeImpl<T>::SetValue(value, m_buffer);
-    }
     //@}
 
     /**
@@ -914,6 +917,7 @@ public:
 
 #if wxUSE_VARIANT
     // GetAs() wxVariant specialization
+    template<>
     bool GetAs(wxVariant* value) const
     {
         return wxConvertAnyToVariant(*this, value);
index 86c60ec187fe78c0516c11f31f173af40853d360..57aba64bb1d84925d12e6a109239292675359905 100644 (file)
@@ -224,15 +224,15 @@ wxAny wxVariant::GetAny() const
     wxAny any;
 
     if ( IsNull() )
-        return wxAny((const wxAny&)any);
+        return any;
 
     wxVariantData* data = GetData();
 
     if ( data->GetAsAny(&any) )
-        return wxAny((const wxAny&)any);
+        return any;
 
     // If everything else fails, wrap the whole wxVariantData
-    return wxAny(((wxVariantData*)data));
+    return wxAny(data);
 }
 
 #endif // wxUSE_ANY