0

Is implicitly casting objects via function parameters expensive?

For example

Class MyClass : IClass

and the function takes an IClass but instead I give it an MyClass Variable.

MyFunction(IClass myClass) {}
MyClass test = new MyClass()
MyFunction(test);

Is this performance hindering just like normal casting?

EDIT:

I edited it to a case that would compile, sorry. How does this look now?

4

0 回答 0