Hi all,
I've done a pretty basic class in C++/CLI using generics. How can I check if the generic array^ equals nullptr?
generic<class T> where T: IGenericContainable
public ref class FIBEXGenericContainer abstract : AbstractFIBEXNode
{
public:
property array<T>^ Children;
public:
property T default[String^]
{
T get(String^ aID)
{
if(nullptr == Children)
Console::WriteLine("this won't happen, because I get an NullReferenceException in the above line");
for each(T tObj in Children)
{
if(aID == tObj->ID)
return tObj;
}
return T();
}
}
};
Thank you guys!