Timeline for Why breakpoint is not reached in VisualStudio 2010?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 2, 2015 at 4:28 | vote | accept | callyaser | ||
Feb 2, 2015 at 4:19 | comment | added | Michael Stum | (This is an optimization technique since Iterators can be expensive to run, or even infinite. It's the callers responsibility to decide if, when, and how long to run it) | |
Feb 2, 2015 at 4:18 | comment | added | Michael Stum |
@callyaser No, you're calling a function that returns an IEnumerable - in other words, GetNosLessThan5 returns an object that says "I can be iterated over". It does not return the result of the enumeration - for that you'd have to call .ToList or a similar method that actually calculates the numbers. Iterators are a bit of compiler magic in C#.
|
|
Feb 2, 2015 at 4:16 | comment | added | callyaser | But sir inside main there is a call to the function right? so the function should be executed right. ? | |
Feb 2, 2015 at 4:14 | history | answered | Michael Stum | CC BY-SA 3.0 |