Mimic the C# yield instruction in VC++

November 29th, 2007

Recently mickey0 posted a question on the CodeGuru forum, asking whether VC++ had any syntax similar to the C# yield instruction. Although I knew the answer was ‘no’, I was still intrigued to figure out if it was possible to implement something similar.

I started with a web search and found a couple of existing implementations, all of which were using Win32 Fibers, so I realized that fibers was the way to go. Even though the examples I found was good tutorials on fibers, they did not meet my requirements on a proper yield implementation. So I had to get dirty. Read the rest of this entry »

Powered by WordPress. Entries (RSS) and Comments (RSS).