test for value type

  • Thread starter Thread starter Mark Oliver
  • Start date Start date
M

Mark Oliver

Hi, Is there a way to tell if an abritrary type is a value or reference
type? In my application i need to add both kinds to a
System.Collections.Queue, for reference types i need to make deep copies.

Thanks,
Mark
 
Mark,
All value types inherit from System.ValueType.

Try something like:
if (x is ValueType)
{
}

Hope this helps
Jay
 
Hi Jay
Thanks very much, that gets it done.
Mark

Jay B. Harlow said:
Mark,
All value types inherit from System.ValueType.

Try something like:
if (x is ValueType)
{
}

Hope this helps
Jay
 
Back
Top