G
Giulio Petrucci
Hi there,
Please, could you take a look to the code below? My questions are inline:
public class SmartArray<T>
{
protected T[] array;
protected virtual T this[int index]
{
get
{
if ((index<0)||(index>=array.Length))
{
//what I need to do is:
//if T is nullable (I think it's the same to say that's
a ref type, roght?) then return "null"
//else rise an Exception;
}
else return array[index];
}
}
}
Any suggestion?
Thanks in advance!
Cheer,
Giulio - Italia
Please, could you take a look to the code below? My questions are inline:
public class SmartArray<T>
{
protected T[] array;
protected virtual T this[int index]
{
get
{
if ((index<0)||(index>=array.Length))
{
//what I need to do is:
//if T is nullable (I think it's the same to say that's
a ref type, roght?) then return "null"
//else rise an Exception;
}
else return array[index];
}
}
}
Any suggestion?
Thanks in advance!
Cheer,
Giulio - Italia