For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2005 > Does passing a struct in a objectcause boxing?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Does passing a struct in a objectcause boxing?
jjasonclark@spamless.gmail.com

2005-03-16, 3:59 am

I have an application that invokes methods via the MethodInfo class.
The method I am invoking takes a struct as the sole parameter. The
question is does passing this struct inside of the object[] that
MethodInfo.Invoke needs cause boxing?

object myObject = some object
MethodInfo m = some reflected method from myObject

m.Invoke(myObject, new object[] {new MyStruct()});

Thanks,
Jason

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com