Last active
August 29, 2015 14:05
-
-
Save rogeralsing/965c3ba740f0c43bd90e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo<T> where T: IDoStuff | |
{ | |
private T _stuffer; | |
public Foo(T stuffer) | |
{ | |
_stuffer = stuffer; | |
} | |
public void Bar() | |
{ | |
//will this be a direct call or resolved through interface lookup? | |
_stuffer.StuffTheStuff(); | |
} | |
} |
Well you can: use structs :)
But really, I don't think that is going to be an important part of any performance issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome answer!
Too bad I couldn't hack my way past virtual lookup though.