This file contains hidden or 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
| static class EnumerableExtensions | |
| { | |
| /* Zips an arbitrary number of collections. | |
| Parameters: | |
| * sources: a collection of collections to zip. | |
| * resultSelector: a function to process every 'slice' of the zipper and produce a result object. | |
| * stopOnFirstSource: when 'true', the method will stop zipping when any of sources exhausted; | |
| otherwize it will continue zipping until all sources are exhauste |
This file contains hidden or 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
| //------------------------------------------------------------------- | |
| // Provides a "finally" lambda block for C++. | |
| // Example: | |
| // | |
| // void ReenterableFunction() { | |
| // static bool isActive = true; // static reenterability flag | |
| // | |
| // if (isActive) return; // check the flag | |
| // auto reset = finally([&]{ isActive = false; }); // we need to reset the flag on exit, even if there was an exception in the code below. | |
| // isActive = true; // set the flag and proceed |
NewerOlder