Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
under the covers is there an object creation going on if I do like

C#
class MyEnum : IEnumerable<char> {
  public GetEnumerator() { ... }
  IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 

}


my question is does the => operator used here resolve strictly to a forwarded method call, or is there ever a delegate or something instantiated to make it work?

What I have tried:

i tried ildasm but i'm rusty. i tried google but i'm not getting any easy results.
Posted
Updated 29-Jul-19 15:01pm
v2

1 solution

Quote:
Expression-bodied and block-bodied implementations compile to the same IL, so there is no difference in performance between them.
[^] It's just semantic sugar for method and property declarations. Also: [^]
 
Share this answer
 
v2
Comments
honey the codewitch 30-Jul-19 1:19am    
thanks! and just what I was hoping for.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900