/**
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;
}
#if wxUSE_VARIANT
+ template<>
wxAny(const wxVariant& variant)
{
m_type = wxAnyNullValueType;
}
#endif
- template<typename T>
- wxAny(const T& value)
- {
- m_type = wxAnyValueTypeImpl<T>::sm_instance;
- wxAnyValueTypeImpl<T>::SetValue(value, m_buffer);
- }
//@}
/**
#if wxUSE_VARIANT
// GetAs() wxVariant specialization
+ template<>
bool GetAs(wxVariant* value) const
{
return wxConvertAnyToVariant(*this, value);
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