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
{ | |
// resources are easy to gain by capture, and use in the destructor | |
std::shared_ptr<int> cleaner(nullptr, [some_captures](int *) { do_something(); }); | |
} |
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
// Simple State Machine with clever transition-event management | |
// created by yiminghu:github.com/Danielhu | |
using System.Collections.Generic; | |
public class StateMachine<StateType>{ | |
public delegate void TransitionDelegate(); |