captured-variable Questions

11

Solved

I met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() =...
Roede asked 7/11, 2008 at 7:26

1

Solved

In "Captured Variables" how a variable is captured? What does that 'Captured' term stands for actually? Does it mean referencing a value type without getting the boxing involved? Thanks
Ricotta asked 19/10, 2012 at 5:48

4

Solved

I'm having a problem with foreach(var category in categories) { foreach(var word in words) { var waitCallback = new WaitCallback(state => { DoSomething(word, category); }); ThreadPool.Q...
Parliament asked 19/4, 2011 at 13:33

3

Solved

I'm currently musing about some idea I can't get right. The problem is that I want to use one lambda function to instantiate a captured variable and another lambda to access a property of that var...
Fosque asked 10/6, 2009 at 9:10
1

© 2022 - 2024 — McMap. All rights reserved.